diff options
| -rw-r--r-- | api/src/glfs.c | 2 | ||||
| -rw-r--r-- | libglusterfs/src/mem-pool.c | 6 | 
2 files changed, 5 insertions, 3 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index 8410504059a..418c6c5d285 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -149,8 +149,6 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx)  	LOCK_INIT (&pool->lock);  	ctx->pool = pool; -	LOCK_INIT (&ctx->lock); -  	ret = 0;  err:  	if (ret && pool) { diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index 78fecec4b0f..88fbdf58319 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -422,7 +422,11 @@ mem_pool_new_fn (unsigned long sizeof_type,          if (!ctx)                  goto out; -        list_add (&mem_pool->global_list, &ctx->mempool_list); +        LOCK (&ctx->lock); +        { +                list_add (&mem_pool->global_list, &ctx->mempool_list); +        } +        UNLOCK (&ctx->lock);  out:          return mem_pool;  | 
