Skip to content

Commit

Permalink
Change must-double-locking in 03-practical/21-pfscan_combine_minimal …
Browse files Browse the repository at this point in the history
…to TODO

On MacOS the mutex type is top because it's zero-initialized global.
On MacOS zero-initialized mutex isn't the same as a default mutex (type 0).
  • Loading branch information
sim642 committed Nov 29, 2024
1 parent 218770b commit f3dfca7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/regression/03-practical/21-pfscan_combine_minimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ int pqueue_init(PQUEUE *qp)

void pqueue_close(PQUEUE *qp )
{
pthread_mutex_lock(& qp->mtx); // WARN (must double locking)
pthread_mutex_lock(& qp->mtx); // TODO (OSX): WARN (must double locking)
qp->closed = 1;
pthread_mutex_unlock(& qp->mtx);
return;
}

int pqueue_put(PQUEUE *qp)
{
pthread_mutex_lock(& qp->mtx); // WARN (must double locking)
pthread_mutex_lock(& qp->mtx); // TODO (OSX): WARN (must double locking)
if (qp->closed) {
// pfscan actually has a bug and is missing the following unlock at early return
// pthread_mutex_unlock(& qp->mtx);
Expand Down

0 comments on commit f3dfca7

Please sign in to comment.