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

Function hb_lock_init

libhb/ports.c:1098–1114  ·  view source on GitHub ↗

* hb_lock_init() * hb_lock_close() * hb_lock() * hb_unlock() ************************************************************************ * Basic wrappers to OS-specific semaphore or mutex functions. ***********************************************************************/

Source from the content-addressed store, hash-verified

1096 * Basic wrappers to OS-specific semaphore or mutex functions.
1097 ***********************************************************************/
1098hb_lock_t * hb_lock_init()
1099{
1100 hb_lock_t * l = calloc( sizeof( hb_lock_t ), 1 );
1101
1102 pthread_mutexattr_t mta;
1103
1104 pthread_mutexattr_init(&mta);
1105
1106#if defined( SYS_CYGWIN ) || defined( SYS_FREEBSD ) || defined( SYS_NETBSD ) || \
1107 defined( SYS_OPENBSD )
1108 pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_NORMAL);
1109#endif
1110
1111 pthread_mutex_init( &l->mutex, &mta );
1112
1113 return l;
1114}
1115
1116void hb_lock_close( hb_lock_t ** _l )
1117{

Callers 9

hb_initFunction · 0.85
taskset_initFunction · 0.85
muxInitFunction · 0.85
syncVideoInitFunction · 0.85
hb_errorFunction · 0.85
nlmeans_initFunction · 0.85
hb_thread_initFunction · 0.85
hb_buffer_pool_initFunction · 0.85
hb_fifo_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected