summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorKristj?n Valur J?nsson <sweskman@gmail.com>2013-03-19 20:18:37 -0700
committerKristj?n Valur J?nsson <sweskman@gmail.com>2013-03-19 20:18:37 -0700
commit9db477cd54e310c9d945c6348dc44e97e3ba72f9 (patch)
tree6dde96e558f939f1988d0d9216164a012898f476 /Python
parent9541c76a4f4770a4300d581958db3181ea13f94f (diff)
downloadcpython-9db477cd54e310c9d945c6348dc44e97e3ba72f9.tar.gz
Issue #15038 : Fixing the condition broadcast and docs.
Diffstat (limited to 'Python')
-rw-r--r--Python/condvar.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/condvar.h b/Python/condvar.h
index fe6bd74da8..bbb40ba18e 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -163,10 +163,9 @@ PyCOND_TIMEDWAIT(PyCOND_T *cond, PyMUTEX_T *mut, long us)
Generic emulations of the pthread_cond_* API using
earlier Win32 functions can be found on the Web.
- The following read can be edificating (or not):
+ The following read can be give background information to these issues,
+ but the implementations are all broken in some way.
http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
-
- See also
*/
typedef CRITICAL_SECTION PyMUTEX_T;
@@ -297,9 +296,10 @@ PyCOND_SIGNAL(PyCOND_T *cv)
Py_LOCAL_INLINE(int)
PyCOND_BROADCAST(PyCOND_T *cv)
{
- if (cv->waiting > 0) {
- return ReleaseSemaphore(cv->sem, cv->waiting, NULL) ? 0 : -1;
- cv->waiting = 0;
+ int waiting = cv->waiting;
+ if (waiting > 0) {
+ cv->waiting = 0;
+ return ReleaseSemaphore(cv->sem, waiting, NULL) ? 0 : -1;
}
return 0;
}