Go to the documentation of this file.
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);
99 static 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)
static void add_task(AVTask **prev, AVTask *t)
static void executor_free(AVExecutor *e, const int has_lock, const int has_cond)
static int ff_mutex_init(AVMutex *mutex, const void *attr)
static double cb(void *priv, double x, double y)
static int ff_cond_broadcast(AVCond *cond)
#define executor_thread_join(t, r)
static int ff_mutex_unlock(AVMutex *mutex)
AVExecutor * av_executor_alloc(const AVTaskCallbacks *cb, int thread_count)
Alloc executor.
static int ff_cond_wait(AVCond *cond, AVMutex *mutex)
static int ff_mutex_destroy(AVMutex *mutex)
static int run_one_task(AVExecutor *e, void *lc)
#define executor_thread_create(t, a, s, ar)
static int ff_mutex_lock(AVMutex *mutex)
#define i(width, name, range_min, range_max)
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
void * av_calloc(size_t nmemb, size_t size)
static AVTask * remove_task(AVTask **prev, AVTask *t)
void av_executor_free(AVExecutor **executor)
Free executor.
void av_executor_execute(AVExecutor *e, AVTask *t)
Add task to executor.
static int ff_cond_signal(AVCond *cond)
static int ff_cond_destroy(AVCond *cond)
static int ff_cond_init(AVCond *cond, const void *attr)