Need to lock mutex before signal

This commit is contained in:
Gregory Nutt 2013-11-02 08:10:24 -06:00
parent 2a215127a0
commit 4d39db749b
1 changed files with 3 additions and 1 deletions

View File

@ -2678,6 +2678,8 @@ void *usbmsc_workerthread(void *arg)
/* Transition to the TERMINATED state and exit */ /* Transition to the TERMINATED state and exit */
priv->thstate = USBMSC_STATE_TERMINATED; priv->thstate = USBMSC_STATE_TERMINATED;
pthread_cond_signal(&priv->cond); /* REVISIT: See comments in usbmsc_uninitialize() */ pthread_mutex_lock(&priv->mutex); /* REVISIT: See comments in usbmsc_uninitialize() */
pthread_cond_signal(&priv->cond);
pthread_mutex_unlock(&priv->mutex);
return NULL; return NULL;
} }