Merge pull request #3877 from gummif/gfa/spinlock-fix

Problem: Spinning on atomics can cause hangs
This commit is contained in:
Luca Boccassi 2020-04-18 22:21:47 +01:00 committed by GitHub
commit 08d94d0e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,6 +103,7 @@ void wait_in_events (test_events_t &events_)
{
void *watch = zmq_stopwatch_start ();
while (events_.in_events.get () < 1) {
msleep (1);
#ifdef ZMQ_BUILD_DRAFT
TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME,
zmq_stopwatch_intermediate (watch),
@ -116,6 +117,7 @@ void wait_timer_events (test_events_t &events_)
{
void *watch = zmq_stopwatch_start ();
while (events_.timer_events.get () < 1) {
msleep (1);
#ifdef ZMQ_BUILD_DRAFT
TEST_ASSERT_LESS_OR_EQUAL_MESSAGE (SETTLE_TIME,
zmq_stopwatch_intermediate (watch),