diff options
Diffstat (limited to 'src/pi_tests/pi_stress.c')
-rw-r--r-- | src/pi_tests/pi_stress.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index aaa36c3..1d1cc58 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -727,17 +727,24 @@ void *low_priority(void *arg) status = pthread_barrier_wait(&p->locked_barrier); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { pi_error - ("low_priority[%d]: pthread_barrier_wait(locked): %x\n", - p->id, status); + ("low_priority[%d]: pthread_barrier_wait(locked): %x\n", + p->id, status); + /* release the mutex */ + pi_debug("low_priority[%d]: unlocking mutex\n", p->id); + pthread_mutex_unlock(&p->mutex); return NULL; } + /* wait for priority boost */ pi_debug("low_priority[%d]: entering elevated wait\n", p->id); status = pthread_barrier_wait(&p->elevate_barrier); if (status && status != PTHREAD_BARRIER_SERIAL_THREAD) { pi_error - ("low_priority[%d]: pthread_barrier_wait(elevate): %x\n", - p->id, status); + ("low_priority[%d]: pthread_barrier_wait(elevate): %x\n", + p->id, status); + /* release the mutex */ + pi_debug("low_priority[%d]: unlocking mutex\n", p->id); + pthread_mutex_unlock(&p->mutex); return NULL; } |