| 69 | } |
| 70 | |
| 71 | static void *attribute_align_arg thread_worker(void *v) |
| 72 | { |
| 73 | WorkerContext *w = v; |
| 74 | AVSliceThread *ctx = w->ctx; |
| 75 | |
| 76 | pthread_mutex_lock(&w->mutex); |
| 77 | pthread_cond_signal(&w->cond); |
| 78 | |
| 79 | while (1) { |
| 80 | w->done = 1; |
| 81 | while (w->done) |
| 82 | pthread_cond_wait(&w->cond, &w->mutex); |
| 83 | |
| 84 | if (ctx->finished) { |
| 85 | pthread_mutex_unlock(&w->mutex); |
| 86 | return NULL; |
| 87 | } |
| 88 | |
| 89 | if (run_jobs(ctx)) { |
| 90 | pthread_mutex_lock(&ctx->done_mutex); |
| 91 | ctx->done = 1; |
| 92 | pthread_cond_signal(&ctx->done_cond); |
| 93 | pthread_mutex_unlock(&ctx->done_mutex); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | av_cold |
| 99 | int avpriv_slicethread_create(AVSliceThread **pctx, void *priv, |
nothing calls this directly
no test coverage detected