1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-02-02 10:04:33 +00:00

Must unlock mutex if pthread_cond_wait succeeds.

This commit is contained in:
ckolivas 2012-07-02 12:37:15 +10:00
parent efcce5bbb8
commit df5d196f9a

View File

@ -2486,13 +2486,17 @@ int restart_wait(struct timeval *tdiff)
{
struct timeval now, then;
struct timespec abstime;
int rc;
gettimeofday(&now, NULL);
timeradd(&now, tdiff, &then);
abstime.tv_sec = then.tv_sec;
abstime.tv_nsec = then.tv_usec * 1000;
mutex_lock(&restart_lock);
return pthread_cond_timedwait(&restart_cond, &restart_lock, &abstime);
rc = pthread_cond_timedwait(&restart_cond, &restart_lock, &abstime);
if (!rc)
mutex_unlock(&restart_lock);
return rc;
}
static void restart_threads(void)