Branch: Tag:

2017-08-10

2017-08-10 12:00:09 by Henrik Grubbström (Grubba) <grubba@grubba.org>

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;   }