Skip to content

Commit

Permalink
Fix for race condition due to m_callbacks_running being altered witho…
Browse files Browse the repository at this point in the history
…ut mutex protection

Fixes Cylix#32
  • Loading branch information
aardvarkk committed Jan 15, 2017
1 parent 18bf45a commit cb7ee8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sources/redis_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ redis_client::connection_receive_handler(network::redis_connection&, reply& repl
callback(reply);
}

m_callbacks_running -= 1;
{
std::lock_guard<std::mutex> lock(m_callbacks_mutex);
m_callbacks_running -= 1;
}
m_sync_condvar.notify_all();
}

Expand Down

0 comments on commit cb7ee8d

Please sign in to comment.