File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
src/main/java/org/jboss/netty/channel/socket/nio Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -568,15 +568,21 @@ private void write0(final NioDatagramChannel channel) {
568568 }
569569 }
570570 channel .inWriteNowLoop = false ;
571+
572+ // Initially, the following block was executed after releasing
573+ // the writeLock, but there was a race condition, and it has to be
574+ // executed before releasing the writeLock:
575+ //
576+ // https://issues.jboss.org/browse/NETTY-410
577+ //
578+ if (addOpWrite ) {
579+ setOpWrite (channel );
580+ } else if (removeOpWrite ) {
581+ clearOpWrite (channel );
582+ }
571583 }
572584
573585 fireWriteComplete (channel , writtenBytes );
574-
575- if (addOpWrite ) {
576- setOpWrite (channel );
577- } else if (removeOpWrite ) {
578- clearOpWrite (channel );
579- }
580586 }
581587
582588 private void setOpWrite (final NioDatagramChannel channel ) {
You can’t perform that action at this time.
0 commit comments