mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
thread.c: drop WebPWorker prefix from static funcs
Change-Id: I7cd39c9e41bbf11157c488aff18631ef17fde464
This commit is contained in:
parent
1aed8f2afc
commit
8924a3a704
@ -133,7 +133,7 @@ static int pthread_cond_wait(pthread_cond_t* const condition,
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
static THREADFN WebPWorkerThreadLoop(void *ptr) { // thread loop
|
||||
static THREADFN ThreadLoop(void* ptr) { // thread loop
|
||||
WebPWorker* const worker = (WebPWorker*)ptr;
|
||||
int done = 0;
|
||||
while (!done) {
|
||||
@ -157,8 +157,8 @@ static THREADFN WebPWorkerThreadLoop(void *ptr) { // thread loop
|
||||
}
|
||||
|
||||
// main thread state control
|
||||
static void WebPWorkerChangeState(WebPWorker* const worker,
|
||||
WebPWorkerStatus new_status) {
|
||||
static void ChangeState(WebPWorker* const worker,
|
||||
WebPWorkerStatus new_status) {
|
||||
// no-op when attempting to change state on a thread that didn't come up
|
||||
if (worker->status_ < OK) return;
|
||||
|
||||
@ -186,7 +186,7 @@ void WebPWorkerInit(WebPWorker* const worker) {
|
||||
|
||||
int WebPWorkerSync(WebPWorker* const worker) {
|
||||
#ifdef WEBP_USE_THREAD
|
||||
WebPWorkerChangeState(worker, OK);
|
||||
ChangeState(worker, OK);
|
||||
#endif
|
||||
assert(worker->status_ <= OK);
|
||||
return !worker->had_error;
|
||||
@ -202,7 +202,7 @@ int WebPWorkerReset(WebPWorker* const worker) {
|
||||
return 0;
|
||||
}
|
||||
pthread_mutex_lock(&worker->mutex_);
|
||||
ok = !pthread_create(&worker->thread_, NULL, WebPWorkerThreadLoop, worker);
|
||||
ok = !pthread_create(&worker->thread_, NULL, ThreadLoop, worker);
|
||||
if (ok) worker->status_ = OK;
|
||||
pthread_mutex_unlock(&worker->mutex_);
|
||||
#else
|
||||
@ -217,7 +217,7 @@ int WebPWorkerReset(WebPWorker* const worker) {
|
||||
|
||||
void WebPWorkerLaunch(WebPWorker* const worker) {
|
||||
#ifdef WEBP_USE_THREAD
|
||||
WebPWorkerChangeState(worker, WORK);
|
||||
ChangeState(worker, WORK);
|
||||
#else
|
||||
if (worker->hook)
|
||||
worker->had_error |= !worker->hook(worker->data1, worker->data2);
|
||||
@ -227,7 +227,7 @@ void WebPWorkerLaunch(WebPWorker* const worker) {
|
||||
void WebPWorkerEnd(WebPWorker* const worker) {
|
||||
if (worker->status_ >= OK) {
|
||||
#ifdef WEBP_USE_THREAD
|
||||
WebPWorkerChangeState(worker, NOT_OK);
|
||||
ChangeState(worker, NOT_OK);
|
||||
pthread_join(worker->thread_, NULL);
|
||||
pthread_mutex_destroy(&worker->mutex_);
|
||||
pthread_cond_destroy(&worker->condition_);
|
||||
|
Loading…
Reference in New Issue
Block a user