Skip to content

Commit

Permalink
better static mutex initialization (thanks Vincent)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurent Sansonetti committed Jul 6, 2011
1 parent d1d50ef commit 3b5da11
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions symbol.c
Expand Up @@ -18,7 +18,7 @@

VALUE rb_cSymbol;

static pthread_mutex_t local_lock;
static pthread_mutex_t local_lock = PTHREAD_MUTEX_INITIALIZER;
#define LOCK() (assert(pthread_mutex_lock(&local_lock) == 0))
#define UNLOCK() (assert(pthread_mutex_unlock(&local_lock) == 0))

Expand Down Expand Up @@ -301,7 +301,6 @@ struct rb_op_tbl_entry rb_op_tbl[] = {
void
Init_PreSymbol(void)
{
assert(pthread_mutex_init(&local_lock, 0) == 0);
sym_id = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
assert(sym_id != NULL);
id_str = CFDictionaryCreateMutable(NULL, 0, NULL,
Expand Down

0 comments on commit 3b5da11

Please sign in to comment.