Skip to content
Snippets Groups Projects
Commit 4c630422 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Thread.Queue [Paranoia]: Attempt to work around glibc bugs.

Glibc 2.24 and earlier have a broken implementation of condition
variables (cf https://sourceware.org/bugzilla/show_bug.cgi?id=13165).

Attempt to work around the issue by having the signalling thread
release the associated mutex before signalling.

Potential fix for [Pike-140].
parent 1de8a9f7
No related branches found
No related tags found
No related merge requests found
......@@ -378,8 +378,12 @@ optional class Queue {
buffer[w_ptr] = value;
w_ptr++;
int items = w_ptr - r_ptr;
r_cond::broadcast();
// NB: The mutex MUST be released before the broadcast to work
// around bugs in glibc 2.24 and earlier. This seems to
// affect eg RHEL 7 (glibc 2.17).
// cf https://sourceware.org/bugzilla/show_bug.cgi?id=13165
key=0;
r_cond::broadcast();
return items;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment