Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Commit 50cad5a

Browse files
committed
patch deadlock in the redis_client when sending command. Origin was deep, due to interleaved locks between redis_command & io_service through callbacks.
1 parent 9a68fc1 commit 50cad5a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sources/redis_client.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ redis_client::is_connected(void) {
3131

3232
void
3333
redis_client::send(const std::vector<std::string>& redis_cmd, const reply_callback_t& callback) {
34-
std::lock_guard<std::mutex> lock(m_callbacks_mutex);
35-
3634
m_client.send(redis_cmd);
35+
36+
std::lock_guard<std::mutex> lock(m_callbacks_mutex);
3737
m_callbacks.push(callback);
3838
}
3939

0 commit comments

Comments
 (0)