public
Created

Recursive lock Ruby

  • Download Gist
thread_pthread.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/**
* Line 227
*/
static void
native_mutex_initialize(pthread_mutex_t *lock)
{
/*
* Creating mutex attribute with Mutex Recursive
* option, to allow self lock.
*/
pthread_mutexattr_t attribute;
pthread_mutexattr_init(&attribute);
pthread_mutexattr_settype(&attribute, PTHREAD_MUTEX_RECURSIVE);
int r = pthread_mutex_init(lock, &attribute);
mutex_debug("init", lock);
if (r != 0) {
rb_bug_errno("pthread_mutex_init", r);
}
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.