netty5/common/src/main/java/io/netty/util
Jason Tedor cfd6db7915 Avoid missed signals on a default promise
Motivation:

Today when awaiting uninterruptibly on a default promise, a race
condition can lead to a missed signal. Quite simply, the check for
whether the condition holds is not made inside a lock before
waiting. This means that the waiting thread can enter the wait after the
promise has completed and will thus not be notified, thus missing the
signal. This leads to the waiting thread to enter a timed wait that will
only trip with the timeout elapses leading to unnecessarily long waits
(imagine a connection timeout, and the waiting thread missed the signal
that the connection is ready).

Modification:

This commit fixes this missed signal by checking the condition inside a
lock. We also add a test that reliably fails without the non-racy
condition check.

Result:

Timed uninterruptible waits on default promise will not race against the
condition and possibly wait longer than necessary.
2016-07-12 09:57:14 +02:00
..
concurrent Avoid missed signals on a default promise 2016-07-12 09:57:14 +02:00
internal DnsNameResolver search domains support 2016-07-08 22:04:01 +02:00
AbstractConstant.java Fix a bug where AbstractConstant.compareTo() returns 0 for different constants 2014-07-29 15:01:47 -07:00
AbstractReferenceCounted.java Fix most inspector warnings 2014-07-02 19:55:07 +09:00
AsciiString.java HPACK Encoder headerFields improvements 2016-06-30 09:00:12 -07:00
AsyncMapping.java Allow to do async mappings in the SniHandler 2016-01-18 21:02:13 +01:00
Attribute.java Document the contract of Attribute.getAndSet(...) and set(...) 2015-04-14 09:53:53 +02:00
AttributeKey.java Fix errors reported by javadoc 2015-12-27 08:36:45 +01:00
AttributeMap.java Better implementation of AttributeMap and also add hasAttr(...). SeeĀ [#2439] 2014-05-15 06:47:42 +02:00
BooleanSupplier.java DefaultHttp2Connection.close Reentrant Modification 2016-05-09 14:16:30 -07:00
ByteProcessor.java HttpConversionUtil remove throws from method signature 2016-01-15 10:53:34 +01:00
CharsetUtil.java Add CharsetUtil.encoder/decoder() methods 2016-03-07 10:48:31 +00:00
Constant.java Replace UniqueName with Constant and ConstantPool 2014-02-13 15:14:34 -08:00
ConstantPool.java Fix errors reported by javadoc 2015-12-27 08:36:45 +01:00
DefaultAttributeMap.java Fix possible AttributeMap corruption on double removal 2015-03-10 05:08:41 +01:00
DomainMappingBuilder.java Replace DomainMappingBuilder with DomainNameMappingBuilder 2016-05-18 12:03:14 +02:00
DomainNameMapping.java Fix NPE when creating DomainNameMapping via a builder 2016-05-18 19:26:28 +09:00
DomainNameMappingBuilder.java Replace DomainMappingBuilder with DomainNameMappingBuilder 2016-05-18 12:03:14 +02:00
HashedWheelTimer.java Use ResourceLeakDetectorFactory in HashedWheelTimer 2016-06-29 21:07:17 +02:00
HashingStrategy.java Removed unused imports 2016-01-04 14:32:29 +01:00
IllegalReferenceCountException.java ReferenceCountException -> IllegalReferenceCountException 2013-06-13 14:00:15 +09:00
IntSupplier.java Allow to customize NIO (channel) select strategies. 2016-03-30 15:01:25 -07:00
Mapping.java Overall clean-up of the initial SniHandler/DomainNameMapping work 2014-12-04 18:23:07 +09:00
NetUtil.java [#4936] NetUtil can prevent using Netty due to SecurityManager denial 2016-03-14 12:10:16 +01:00
package-info.java Remove apiviz tags - we are focusing on user guide instead and putting diagrams there 2013-02-14 12:09:16 -08:00
Recycler.java Fix the possible reference leak in Recycler 2016-06-01 06:47:43 +02:00
ReferenceCounted.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
ReferenceCountUtil.java Port ChannelOutboundBuffer and related changes from 4.0 2014-08-05 15:00:45 +02:00
ResourceLeak.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
ResourceLeakDetector.java Use ResourceLeakDetectorFactory in HashedWheelTimer 2016-06-29 21:07:17 +02:00
ResourceLeakDetectorFactory.java Use ResourceLeakDetectorFactory in HashedWheelTimer 2016-06-29 21:07:17 +02:00
ResourceLeakException.java Ensure backward compatibility 2013-12-05 01:02:38 +09:00
ResourceLeakHint.java Enable a user specify an arbitrary information with ReferenceCounted.touch() 2014-02-13 18:16:25 -08:00
Signal.java Fix a bug where AbstractConstant.compareTo() returns 0 for different constants 2014-07-29 15:01:47 -07:00
ThreadDeathWatcher.java Use shaded dependency on JCTools instead of copy and paste 2016-06-10 13:19:45 +02:00
Timeout.java Simpler method naming in Timeout 2012-12-26 13:50:01 +09:00
Timer.java Remove apiviz tags - we are focusing on user guide instead and putting diagrams there 2013-02-14 12:09:16 -08:00
TimerTask.java Update license headers 2012-06-04 13:31:44 -07:00
Version.java Fix most inspector warnings 2014-07-02 19:55:07 +09:00