PromiseTask.isCancelled performs an unsynchronized read (#10066)
Motivation: PromiseTask.isCancelled performs an unsynchronized read and so may trigger race-detectors. As this was just done for a small optimization which should not really make a lot of difference we should just remove it. Modifications: Remove unsynchronized read optimization Result: Fixes https://github.com/netty/netty/issues/10026.
This commit is contained in:
parent
a304d61b26
commit
c9f38f855e
@ -176,11 +176,6 @@ class PromiseTask<V> extends DefaultPromise<V> implements RunnableFuture<V> {
|
||||
return clearTaskAfterCompletion(super.cancel(mayInterruptIfRunning), CANCELLED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isCancelled() {
|
||||
return task == CANCELLED || super.isCancelled();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected StringBuilder toStringBuilder() {
|
||||
StringBuilder buf = super.toStringBuilder();
|
||||
|
Loading…
Reference in New Issue
Block a user