diff options
author | Vladimir Kobal <vlad@prokk.net> | 2020-08-17 10:31:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 10:31:25 +0300 |
commit | 43c4d1edaaefd38c5597d6a83a17cdc219ff395e (patch) | |
tree | 626312f89e7760a5a5755a9b92bdcb4048406b25 /exporting/pubsub | |
parent | 3136ef137362e4f4bae50758964e3cbf22ff3e84 (diff) |
Add check for spurious wakeups (#9751)
Diffstat (limited to 'exporting/pubsub')
-rw-r--r-- | exporting/pubsub/pubsub.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/exporting/pubsub/pubsub.c b/exporting/pubsub/pubsub.c index 95a87422a6..ead44ed2ac 100644 --- a/exporting/pubsub/pubsub.c +++ b/exporting/pubsub/pubsub.c @@ -103,7 +103,10 @@ void pubsub_connector_worker(void *instance_p) char error_message[ERROR_LINE_MAX + 1] = ""; uv_mutex_lock(&instance->mutex); - uv_cond_wait(&instance->cond_var, &instance->mutex); + while (!instance->data_is_ready) + uv_cond_wait(&instance->cond_var, &instance->mutex); + instance->data_is_ready = 0; + if (unlikely(instance->engine->exit)) { uv_mutex_unlock(&instance->mutex); |