pike.git/
src/
threads.c
Branch:
Tag:
Non-build tags
All tags
No tags
2017-08-10
2017-08-10 12:00:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>
1c938858490b134ef4b611af09769658ecc9a967 (
17
lines) (+
15
/-
2
)
[
Show
|
Annotate
]
Branch:
8.1
Thread: Added some comments regarding threads_disable.
538:
{ int owner = threads_disabled; pike_low_wait_interpreter (cond COMMA_DLOC_ARGS_OPT);
-
if (!owner && threads_disabled) threads_disabled_wait (DLOC_ARGS_OPT);
+
if (!owner && threads_disabled)
{
+
/* Some other thread has disabled
threads
while we were waiting
+
* for the cond var. We must wait for threads to be reenabled
+
* before proceeding.
+
*/
+
threads
_disabled_wait (DLOC_ARGS_OPT);
}
-
+
}
PMOD_EXPORT int pike_timedwait_interpreter (COND_T *cond, long sec, long nsec
548:
int owner = threads_disabled; int res = pike_low_timedwait_interpreter (cond, sec, nsec COMMA_DLOC_ARGS_OPT);
-
if (!owner && threads_disabled) threads_disabled_wait (DLOC_ARGS_OPT);
+
if (!owner && threads_disabled)
{
+
/* Some other thread has disabled
threads
while we were waiting
+
* for the cond var. We must wait for threads to be reenabled
+
* before proceeding.
+
*/
+
threads
_disabled_wait (DLOC_ARGS_OPT);
+
}
return res; }