#include <stdatomic.h>
#include "cpu.h"
#include "internal.h"
#include "slicethread.h"
#include "mem.h"
#include "thread.h"
#include "avassert.h"
#define MAX_AUTO_THREADS …
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
WorkerContext;
struct AVSliceThread { … };
static int run_jobs(AVSliceThread *ctx)
{ … }
static void *attribute_align_arg thread_worker(void *v)
{ … }
int avpriv_slicethread_create(AVSliceThread **pctx, void *priv,
void (*worker_func)(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads),
void (*main_func)(void *priv),
int nb_threads)
{ … }
void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_main)
{ … }
void avpriv_slicethread_free(AVSliceThread **pctx)
{ … }
#else
int avpriv_slicethread_create(AVSliceThread **pctx, void *priv,
void (*worker_func)(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads),
void (*main_func)(void *priv),
int nb_threads)
{
*pctx = NULL;
return AVERROR(ENOSYS);
}
void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_main)
{
av_assert0(0);
}
void avpriv_slicethread_free(AVSliceThread **pctx)
{
av_assert0(!pctx || !*pctx);
}
#endif