Commit 91f9e138 authored by Simon Marlow's avatar Simon Marlow

Fix hs_try_putmvar003 (#12800)

Summary:
There was a race condition on some shared data when creating the
callback thread.

I couldn't repro the issue without inserting a dummy usleep(100), but
it's definitely a bug.

Test Plan: validate

Reviewers: bgamari, austin, erikd

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2678

GHC Trac Issues: #12800
parent 7d988dd4
......@@ -54,9 +54,9 @@ struct callback_queue* mkCallbackQueue(int use_foreign_export)
pthread_t t;
pthread_mutex_init(&q->lock, NULL);
pthread_cond_init(&q->cond, NULL);
pthread_create(&t, NULL, (threadfunc*)callback, q);
q->pending = NULL;
q->use_foreign_export = use_foreign_export;
pthread_create(&t, NULL, (threadfunc*)callback, q);
return q;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment