MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / ff_pthread_init

Function ff_pthread_init

libavcodec/pthread.c:105–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105av_cold int ff_pthread_init(void *obj, const unsigned offsets[])
106{
107 const unsigned *cur_offset = offsets;
108 unsigned cnt = 0;
109 int err;
110
111#define PTHREAD_INIT_LOOP(type) \
112 for (; *(++cur_offset) != THREAD_SENTINEL; cnt++) { \
113 pthread_ ## type ## _t *dst = (void*)((char*)obj + *cur_offset); \
114 err = pthread_ ## type ## _init(dst, NULL); \
115 if (err) { \
116 err = AVERROR(err); \
117 goto fail; \
118 } \
119 }
120 PTHREAD_INIT_LOOP(mutex)
121 PTHREAD_INIT_LOOP(cond)
122
123fail:
124 *(unsigned*)((char*)obj + offsets[0]) = cnt;
125 return err;
126}

Callers 7

init_threadFunction · 0.85
ff_frame_thread_initFunction · 0.85
omx_encode_initFunction · 0.85
ff_thread_progress_initFunction · 0.85
vp9_decode_initFunction · 0.85
oh_decode_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected