Created
November 5, 2012 14:24
-
-
Save gustavoanatoly/4017432 to your computer and use it in GitHub Desktop.
Recursive lock Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment