diff options
Diffstat (limited to 'src/lua/lua_redis.c')
-rw-r--r-- | src/lua/lua_redis.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c index 2e6211078..e312092cb 100644 --- a/src/lua/lua_redis.c +++ b/src/lua/lua_redis.c @@ -83,9 +83,7 @@ lua_redis_fin (void *arg) if (ud->ctx) { redisAsyncFree (ud->ctx); - g_mutex_lock (lua_mtx); luaL_unref (ud->L, LUA_REGISTRYINDEX, ud->cbref); - g_mutex_unlock (lua_mtx); } } @@ -98,12 +96,7 @@ static void lua_redis_push_error (const gchar *err, struct lua_redis_userdata *ud, gboolean connected) { struct worker_task **ptask; - gboolean need_unlock = FALSE; - /* Avoid LOR here as mutex can be acquired before in lua_call */ - if (g_mutex_trylock (lua_mtx)) { - need_unlock = TRUE; - } /* Push error */ lua_rawgeti (ud->L, LUA_REGISTRYINDEX, ud->cbref); ptask = lua_newuserdata (ud->L, sizeof (struct worker_task *)); @@ -117,9 +110,6 @@ lua_redis_push_error (const gchar *err, struct lua_redis_userdata *ud, gboolean if (lua_pcall (ud->L, 3, 0, 0) != 0) { msg_info ("call to callback failed: %s", lua_tostring (ud->L, -1)); } - if (need_unlock) { - g_mutex_unlock (lua_mtx); - } if (connected) { remove_normal_event (ud->task->s, lua_redis_fin, ud); @@ -136,11 +126,7 @@ static void lua_redis_push_data (const redisReply *r, struct lua_redis_userdata *ud) { struct worker_task **ptask; - gboolean need_unlock = FALSE; - if (g_mutex_trylock (lua_mtx)) { - need_unlock = TRUE; - } /* Push error */ lua_rawgeti (ud->L, LUA_REGISTRYINDEX, ud->cbref); ptask = lua_newuserdata (ud->L, sizeof (struct worker_task *)); @@ -170,9 +156,6 @@ lua_redis_push_data (const redisReply *r, struct lua_redis_userdata *ud) if (lua_pcall (ud->L, 3, 0, 0) != 0) { msg_info ("call to callback failed: %s", lua_tostring (ud->L, -1)); } - if (need_unlock) { - g_mutex_unlock (lua_mtx); - } remove_normal_event (ud->task->s, lua_redis_fin, ud); } |