Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ private static final class EventLoopWorker extends Scheduler.Worker {
private final CachedWorkerPool pool;
private final ThreadWorker threadWorker;
@SuppressWarnings("unused")
volatile int once;
static final AtomicIntegerFieldUpdater<EventLoopWorker> ONCE_UPDATER
= AtomicIntegerFieldUpdater.newUpdater(EventLoopWorker.class, "once");
final AtomicInteger once = new AtomicInteger();

EventLoopWorker(CachedWorkerPool pool) {
this.pool = pool;
Expand All @@ -189,7 +187,7 @@ private static final class EventLoopWorker extends Scheduler.Worker {

@Override
public void unsubscribe() {
if (ONCE_UPDATER.compareAndSet(this, 0, 1)) {
if (once.compareAndSet(0, 1)) {
// unsubscribe should be idempotent, so only do this once
pool.release(threadWorker);
}
Expand Down