MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / hb_thread_init

Function hb_thread_init

libhb/ports.c:1026–1044  ·  view source on GitHub ↗

* hb_thread_init() ************************************************************************ * name: user-friendly name * function: the thread routine * arg: argument of the routine * priority: HB_LOW_PRIORITY or HB_NORMAL_PRIORITY ***********************************************************************/

Source from the content-addressed store, hash-verified

1024 * priority: HB_LOW_PRIORITY or HB_NORMAL_PRIORITY
1025 ***********************************************************************/
1026hb_thread_t * hb_thread_init( const char * name, void (* function)(void *),
1027 void * arg, int priority )
1028{
1029 hb_thread_t * t = calloc( sizeof( hb_thread_t ), 1 );
1030
1031 t->name = strdup( name );
1032 t->function = function;
1033 t->arg = arg;
1034 t->priority = priority;
1035
1036 t->lock = hb_lock_init();
1037
1038 /* Create and start the thread */
1039 pthread_create( &t->thread, NULL,
1040 (void * (*)( void * )) hb_thread_func, t );
1041
1042 hb_deep_log( 2, "thread %"PRIx64" started (\"%s\")", hb_thread_to_integer( t ), t->name );
1043 return t;
1044}
1045
1046/************************************************************************
1047 * hb_thread_close()

Callers 8

hb_register_loggerFunction · 0.85
hb_initFunction · 0.85
taskset_cycleFunction · 0.85
muxInitFunction · 0.85
syncVideoInitFunction · 0.85
hb_work_initFunction · 0.85
do_jobFunction · 0.85
hb_scan_initFunction · 0.85

Calls 3

hb_lock_initFunction · 0.85
hb_deep_logFunction · 0.85
hb_thread_to_integerFunction · 0.85

Tested by

no test coverage detected