More explanation on how dead lock can be produced

This commit is contained in:
Trustin Lee 2009-05-13 01:11:06 +00:00
parent 7e3ecf6b46
commit 06586a6bfc

View File

@ -732,7 +732,9 @@ public class SslHandler extends FrameDecoder implements ChannelDownstreamHandler
if (needsWrap) {
// wrap() acquires pendingUnencryptedWrites first and then
// handshakeLock. If handshakeLock is already hold by the
// current thread, calling wrap() will lead to a dead lock.
// current thread, calling wrap() will lead to a dead lock
// i.e. pendingUnencryptedWrites -> handshakeLock vs.
// handshakeLock -> pendingUnencryptedLock -> handshakeLock
if (!Thread.holdsLock(handshakeLock)) {
wrap(ctx, channel);
}