Use correct object to synchronize on in DefaultChannelPipeline (#9171)

Motivation:

8e72071d76 did adjust how synchronization is done but missed to update one block and so used synchronized (this) while it should be synchronized (handlers) .

Modifications:

Use synchronized (handlers)

Result:

Correctly synchronize
This commit is contained in:
Norman Maurer 2019-05-22 18:50:28 +02:00 committed by GitHub
parent 1465e3ce06
commit f81cd7d05b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,7 +164,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
DefaultChannelHandlerContext newCtx = newContext(name, handler); DefaultChannelHandlerContext newCtx = newContext(name, handler);
EventExecutor executor = executor(); EventExecutor executor = executor();
boolean inEventLoop = executor.inEventLoop(); boolean inEventLoop = executor.inEventLoop();
synchronized (this) { synchronized (handlers) {
if (context(name) != null) { if (context(name) != null) {
throw new IllegalArgumentException("Duplicate handler name: " + name); throw new IllegalArgumentException("Duplicate handler name: " + name);
} }