mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
Merge "utils/thread.c,cosmetics: join a few lines"
This commit is contained in:
commit
c7f66c82b3
@ -183,8 +183,7 @@ static int pthread_cond_wait(pthread_cond_t* const condition,
|
|||||||
#else
|
#else
|
||||||
// note that there is a consumer available so the signal isn't dropped in
|
// note that there is a consumer available so the signal isn't dropped in
|
||||||
// pthread_cond_signal
|
// pthread_cond_signal
|
||||||
if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL))
|
if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL)) return 1;
|
||||||
return 1;
|
|
||||||
// now unlock the mutex so pthread_cond_signal may be issued
|
// now unlock the mutex so pthread_cond_signal may be issued
|
||||||
pthread_mutex_unlock(mutex);
|
pthread_mutex_unlock(mutex);
|
||||||
ok = (WaitForSingleObject(condition->signal_event_, INFINITE) ==
|
ok = (WaitForSingleObject(condition->signal_event_, INFINITE) ==
|
||||||
@ -226,8 +225,7 @@ static THREADFN ThreadLoop(void* ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// main thread state control
|
// main thread state control
|
||||||
static void ChangeState(WebPWorker* const worker,
|
static void ChangeState(WebPWorker* const worker, WebPWorkerStatus new_status) {
|
||||||
WebPWorkerStatus new_status) {
|
|
||||||
// No-op when attempting to change state on a thread that didn't come up.
|
// No-op when attempting to change state on a thread that didn't come up.
|
||||||
// Checking status_ without acquiring the lock first would result in a data
|
// Checking status_ without acquiring the lock first would result in a data
|
||||||
// race.
|
// race.
|
||||||
|
Loading…
Reference in New Issue
Block a user