Go to the documentation of this file.
28 #define ExecutorThread char
30 #define executor_thread_create(t, a, s, ar) 0
31 #define executor_thread_join(t, r) do {} while(0)
35 #define ExecutorThread pthread_t
37 #define executor_thread_create(t, a, s, ar) pthread_create(t, a, s, ar)
38 #define executor_thread_join(t, r) pthread_join(t, r)
79 for (prev = &e->
tasks; *prev && !
cb->ready(*prev,
cb->user_data); prev = &(*prev)->
next)
84 cb->run(t, lc,
cb->user_data);
92 static void *executor_worker_task(
void *
data)
138 int has_lock = 0, has_cond = 0;
139 if (!
cb || !
cb->user_data || !
cb->ready || !
cb->run || !
cb->priority_higher)
158 if (!has_lock || !has_cond)
176 if (!executor || !*executor)
189 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)