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)
103 cb->run(t, lc,
cb->user_data);
112 static void *executor_worker_task(
void *
data)
159 int has_lock = 0, has_cond = 0;
160 if (!
cb || !
cb->user_data || !
cb->run || !
cb->priorities)
186 if (!has_lock || !has_cond)
206 if (!executor || !*executor)
208 thread_count = (*executor)->thread_count;
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)
static int ff_mutex_unlock(AVMutex *mutex)
void ff_executor_free(FFExecutor **executor)
Free executor.
Linear double-ended data structure.
static void add_task(Queue *q, FFTask *t)
static int ff_cond_wait(AVCond *cond, AVMutex *mutex)
void ff_executor_execute(FFExecutor *e, FFTask *t)
Add task to executor.
static FFTask * remove_task(Queue *q)
#define executor_thread_join(t, r)
FFExecutor * ff_executor_alloc(const FFTaskCallbacks *cb, int thread_count)
Alloc executor.
static int ff_mutex_destroy(AVMutex *mutex)
static void executor_free(FFExecutor *e, const int has_lock, const int has_cond)
static int ff_mutex_lock(AVMutex *mutex)
static int run_one_task(FFExecutor *e, void *lc)
#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 int ff_cond_signal(AVCond *cond)
#define executor_thread_create(t, a, s, ar)
static int ff_cond_destroy(AVCond *cond)
static int ff_cond_init(AVCond *cond, const void *attr)