stchang/redis — pull request #5 by m4burns (2014-07-17 03:40:04+00:00)
Title: Fixed up some race conditions.

2265ce5: My changes introduced a race between connection release due to calling `disconnect` and connection release due to thread termination. This is fixed.

ec98067: I modified (P)(UN)SUBSCRIBE to not read a response. Using SUBSCRIBE/UNSUBSCRIBE when at least one channel has been subscribed to could read an incoming message instead of the command response. I added proper handling of this in the connection pool return code: channels are unsubscribed and any remaining messages are drained before the connection is returned to the pool. Finally, I added a synchronizable event for getting the next reply, the synchronization result of which is the reply.