32#define ExecutorThread char
34#define executor_thread_create(t, a, s, ar) 0
35#define executor_thread_join(t, r) do {} while(0)
39#define ExecutorThread pthread_t
41#define executor_thread_create(t, a, s, ar) pthread_create(t, a, s, ar)
42#define executor_thread_join(t, r) pthread_join(t, r)
84 for (prev = &e->
tasks; *prev && !
cb->ready(*prev,
cb->user_data); prev = &(*prev)->
next)
90 cb->run(t, lc,
cb->user_data);
99static void *executor_worker_task(
void *
data)
145 int has_lock = 0, has_cond = 0;
146 if (!
cb || !
cb->user_data || !
cb->ready || !
cb->run || !
cb->priority_higher)
168 if (!has_lock || !has_cond)
188 if (!executor || !*executor)
190 thread_count = (*executor)->thread_count;
203 for (prev = &e->
tasks; *prev &&
cb->priority_higher(*prev, t); prev = &(*prev)->
next)
#define i(width, name, range_min, range_max)
static av_cold void executor_free(FFExecutor *e, const int has_lock, const int has_cond)
static int run_one_task(FFExecutor *e, void *lc)
static FFTask * remove_task(Queue *q)
static void add_task(Queue *q, FFTask *t)
#define executor_thread_join(t, r)
#define executor_thread_create(t, a, s, ar)
AVExecutor * av_executor_alloc(const AVTaskCallbacks *cb, int thread_count)
Alloc executor.
void av_executor_free(AVExecutor **executor)
Free executor.
void av_executor_execute(AVExecutor *e, AVTask *t)
Add task to executor.
static int ff_cond_wait(AVCond *cond, AVMutex *mutex)
static int ff_mutex_unlock(AVMutex *mutex)
static int ff_cond_destroy(AVCond *cond)
static int ff_mutex_lock(AVMutex *mutex)
static int ff_mutex_destroy(AVMutex *mutex)
static int ff_cond_init(AVCond *cond, const void *attr)
static int ff_cond_signal(AVCond *cond)
static int ff_cond_broadcast(AVCond *cond)
static int ff_mutex_init(AVMutex *mutex, const void *attr)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
static double cb(void *priv, double x, double y)