Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Recursive lock Ruby
* 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_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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment