@@ -383,6 +383,7 @@ _dispatch_semaphore_wait_slow(dispatch_semaphore_t dsema,
383
383
uint64_t nsec = _dispatch_timeout (timeout );
384
384
_timeout .tv_sec = (typeof (_timeout .tv_sec ))(nsec / NSEC_PER_SEC );
385
385
_timeout .tv_nsec = (typeof (_timeout .tv_nsec ))(nsec % NSEC_PER_SEC );
386
+ pthread_workqueue_signal_np ();
386
387
ret = slowpath (_dispatch_futex_wait (& dsema -> dsema_futex , & _timeout ));
387
388
} while (ret == false && errno == EINTR );
388
389
@@ -430,6 +431,7 @@ _dispatch_semaphore_wait_slow(dispatch_semaphore_t dsema,
430
431
DISPATCH_SEMAPHORE_VERIFY_RET (ret );
431
432
#elif USE_FUTEX_SEM
432
433
do {
434
+ pthread_workqueue_signal_np ();
433
435
ret = _dispatch_futex_wait (& dsema -> dsema_futex , NULL );
434
436
} while (ret == false && errno == EINTR );
435
437
DISPATCH_SEMAPHORE_VERIFY_RET (ret );
@@ -648,6 +650,7 @@ _dispatch_group_wait_slow(dispatch_semaphore_t dsema, dispatch_time_t timeout)
648
650
uint64_t nsec = _dispatch_timeout (timeout );
649
651
_timeout .tv_sec = (typeof (_timeout .tv_sec ))(nsec / NSEC_PER_SEC );
650
652
_timeout .tv_nsec = (typeof (_timeout .tv_nsec ))(nsec % NSEC_PER_SEC );
653
+ pthread_workqueue_signal_np ();
651
654
ret = slowpath (_dispatch_futex_wait (& dsema -> dsema_futex , & _timeout ));
652
655
} while (ret == false && errno == EINTR );
653
656
@@ -695,6 +698,7 @@ _dispatch_group_wait_slow(dispatch_semaphore_t dsema, dispatch_time_t timeout)
695
698
DISPATCH_SEMAPHORE_VERIFY_RET (ret );
696
699
#elif USE_FUTEX_SEM
697
700
do {
701
+ pthread_workqueue_signal_np ();
698
702
ret = _dispatch_futex_wait (& dsema -> dsema_futex , NULL );
699
703
} while (ret == false && errno == EINTR );
700
704
DISPATCH_SEMAPHORE_VERIFY_RET (ret );
0 commit comments