Skip to content

Commit

Permalink
Fix issue #369 - uninitialized stats_lock
Browse files Browse the repository at this point in the history
"stats_lock is used in the assoc_init() function called in memcached.c, but it
is only initialized in thread_init() that is called after assoc_init()."
  • Loading branch information
dormando committed Dec 28, 2014
1 parent ecea745 commit 543b1a3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions thread.c
Expand Up @@ -47,7 +47,7 @@ pthread_mutex_t atomics_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif

/* Lock for global stats */
static pthread_mutex_t stats_lock;
static pthread_mutex_t stats_lock = PTHREAD_MUTEX_INITIALIZER;

/* Lock to cause worker threads to hang up after being woken */
static pthread_mutex_t worker_hang_lock;
Expand Down Expand Up @@ -770,7 +770,6 @@ void memcached_thread_init(int nthreads, struct event_base *main_base) {
int power;

pthread_mutex_init(&cache_lock, NULL);
pthread_mutex_init(&stats_lock, NULL);
pthread_mutex_init(&worker_hang_lock, NULL);

pthread_mutex_init(&init_lock, NULL);
Expand Down

0 comments on commit 543b1a3

Please sign in to comment.