|
|
@ -3590,7 +3590,7 @@ static void discard_stale(void) |
|
|
|
* work restart is required. Returns the value of pthread_cond_timedwait |
|
|
|
* work restart is required. Returns the value of pthread_cond_timedwait |
|
|
|
* which is zero if the condition was met or ETIMEDOUT if not. |
|
|
|
* which is zero if the condition was met or ETIMEDOUT if not. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
int restart_wait(unsigned int mstime) |
|
|
|
int restart_wait(struct thr_info *thr, unsigned int mstime) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct timeval now, then, tdiff; |
|
|
|
struct timeval now, then, tdiff; |
|
|
|
struct timespec abstime; |
|
|
|
struct timespec abstime; |
|
|
@ -3604,6 +3604,9 @@ int restart_wait(unsigned int mstime) |
|
|
|
abstime.tv_nsec = then.tv_usec * 1000; |
|
|
|
abstime.tv_nsec = then.tv_usec * 1000; |
|
|
|
|
|
|
|
|
|
|
|
mutex_lock(&restart_lock); |
|
|
|
mutex_lock(&restart_lock); |
|
|
|
|
|
|
|
if (thr->work_restart) |
|
|
|
|
|
|
|
rc = ETIMEDOUT; |
|
|
|
|
|
|
|
else |
|
|
|
rc = pthread_cond_timedwait(&restart_cond, &restart_lock, &abstime); |
|
|
|
rc = pthread_cond_timedwait(&restart_cond, &restart_lock, &abstime); |
|
|
|
mutex_unlock(&restart_lock); |
|
|
|
mutex_unlock(&restart_lock); |
|
|
|
|
|
|
|
|
|
|
|