Skip to content

Commit

Permalink
Check must-double-locking in 03-practical/21-pfscan_combine_minimal
Browse files Browse the repository at this point in the history
  • Loading branch information
sim642 committed Nov 29, 2024
1 parent dbdefab commit 218770b
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);
pthread_mutex_lock(& qp->mtx); // WARN (must double locking)
qp->closed = 1;
pthread_mutex_unlock(& qp->mtx);
return;
}

int pqueue_put(PQUEUE *qp)
{
pthread_mutex_lock(& qp->mtx);
pthread_mutex_lock(& qp->mtx); // 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 218770b

Please sign in to comment.