diff options
author | Eli Zaretskii <eliz@gnu.org> | 2013-08-31 14:29:05 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2013-08-31 14:29:05 +0300 |
commit | e57df8f77901a3964d21c3d57fb6769cf4511dc2 (patch) | |
tree | 1a748293f62f70a786b9f6c51662e1c132650528 /src/lisp.h | |
parent | dbe17fefccbff010bbbf6c4d0dccc7b2f3a5e201 (diff) | |
download | emacs-e57df8f77901a3964d21c3d57fb6769cf4511dc2.tar.gz emacs-e57df8f77901a3964d21c3d57fb6769cf4511dc2.tar.bz2 emacs-e57df8f77901a3964d21c3d57fb6769cf4511dc2.zip |
Improve MS-Windows implementation of threads.
src/systhread.c (sys_cond_init): Set the 'initialized' member to
true only if initialization is successful. Initialize wait_count
and wait_count_lock.
(sys_cond_wait, sys_cond_signal, sys_cond_broadcast): If
'initialized' is false, do nothing.
(sys_cond_wait): Fix the implementation to avoid the "missed
wakeup" bug: count the waiting threads, and reset the broadcast
event once the last thread was released.
(sys_cond_signal, sys_cond_broadcast): Use SetEvent instead of
PulseEvent. Don't signal the event if no threads are waiting.
(sys_cond_destroy): Only close non-NULL handles.
(sys_thread_create): Return zero if unsuccessful, 1 if successful.
src/systhread.h (w32thread_cond_t): New member 'initialized'.
Rename waiters_count and waiters_count_lock to wait_count and
wait_count_lock, respectively.
Diffstat (limited to 'src/lisp.h')
0 files changed, 0 insertions, 0 deletions