public boolean compareAndSetState(int expected, int state) { return STATE_UPDATER.compareAndSet(this, expected, state); }
/** * An unsafe operation intended for use by a subclass that sets the reference count of the buffer directly */ protected final void setRefCnt(int newRefCnt) { refCntUpdater.set(this, newRefCnt << 1); // overflow OK here }
public void incrementRunningCount() { int val = runningCountUpdater.incrementAndGet(this); for (;;) { int max = concurrentMaxUpdater.get(this); if (val <= max) { break; } if (concurrentMaxUpdater.compareAndSet(this, max, val)) { break; } } }
public void addExecuteBatchCount(long batchSize) { executeBatchSizeTotalUpdater.addAndGet(this, batchSize); // executeBatchSizeMax for (;;) { int current = executeBatchSizeMaxUpdater.get(this); if (current >= batchSize) { break; } if (executeBatchSizeMaxUpdater.compareAndSet(this, current, (int) batchSize)) { break; } } }
this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous."); if (threadParams.getSubgroupIndex() == 0) { CaseInsensitiveStringEqualsBenchmark_jmhType l_caseinsensitivestringequalsbenchmark0_G = _jmh_tryInit_f_caseinsensitivestringequalsbenchmark0_G(control); control.preSetup(); RawResults res = new RawResults(); int batchSize = iterationParams.getBatchSize(); stringEquals_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_caseinsensitivestringequalsbenchmark0_G); control.preTearDown(); if (control.isLastIteration()) { if (CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.compareAndSet(l_caseinsensitivestringequalsbenchmark0_G, 0, 1)) { try { if (control.isFailing) throw new FailureAssistException(); throw t; } finally { CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.set(l_caseinsensitivestringequalsbenchmark0_G, 0); while (CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.get(l_caseinsensitivestringequalsbenchmark0_G) == 1) { TimeUnit.MILLISECONDS.sleep(l_caseinsensitivestringequalsbenchmark0_G_backoff); l_caseinsensitivestringequalsbenchmark0_G_backoff = Math.max(1024, l_caseinsensitivestringequalsbenchmark0_G_backoff * 2);
private void startThread() { if (state == ST_NOT_STARTED) { if (STATE_UPDATER.compareAndSet(this, ST_NOT_STARTED, ST_STARTED)) { try { doStartThread(); } catch (Throwable cause) { STATE_UPDATER.set(this, ST_NOT_STARTED); PlatformDependent.throwException(cause); } } } }
if (!WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_STARTED, WORKER_STATE_SHUTDOWN)) { if (WORKER_STATE_UPDATER.getAndSet(this, WORKER_STATE_SHUTDOWN) != WORKER_STATE_SHUTDOWN) { INSTANCE_COUNTER.decrementAndGet();
@Override public boolean isStop() { return WORKER_STATE_SHUTDOWN == WORKER_STATE_UPDATER.get(this); }
@Override public void onComplete() { if (TERMINATE_UPDATER.compareAndSet(this, 0, 1)) { outerAction.innerSubscriptions.remove(sequenceId); outerAction.status.compareAndSet(RUNNING, COMPLETING); outerAction.capacity(outerAction.innerSubscriptions.runningComposables); if(FanInSubscription.RUNNING_COMPOSABLE_UPDATER.decrementAndGet(outerAction.innerSubscriptions) == 0){ outerAction.innerSubscriptions.serialComplete(); }else{ outerAction.innerSubscriptions.serialNext(new Zippable<O>(index, null)); } } }
@Override int decrementAndGetRemainingCount(AggregateFutureState state) { return remainingCountUpdater.decrementAndGet(state); } }
public final int incrementAndGet() { return indexUpdater.incrementAndGet(this) & Integer.MAX_VALUE; }
public final int getAndSet(int newValue) { if (newValue < 0) { throw new IllegalArgumentException("new value " + newValue + " < 0"); } return indexUpdater.getAndSet(this, newValue) & Integer.MAX_VALUE; }
void drainAndCancel() { if (WIP.getAndIncrement(this) == 0) { do { cancelAll(); } while (WIP.decrementAndGet(this) != 0); } }
public final int getAndIncrement() { return indexUpdater.getAndIncrement(this) & Integer.MAX_VALUE; }
this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous."); if (threadParams.getSubgroupIndex() == 0) { CaseInsensitiveStringEqualsBenchmark_jmhType l_caseinsensitivestringequalsbenchmark0_G = _jmh_tryInit_f_caseinsensitivestringequalsbenchmark0_G(control); control.preSetup(); RawResults res = new RawResults(); int batchSize = iterationParams.getBatchSize(); toLowerCaseEqualsOther_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_caseinsensitivestringequalsbenchmark0_G); control.preTearDown(); if (control.isLastIteration()) { if (CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.compareAndSet(l_caseinsensitivestringequalsbenchmark0_G, 0, 1)) { try { if (control.isFailing) throw new FailureAssistException(); throw t; } finally { CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.set(l_caseinsensitivestringequalsbenchmark0_G, 0); while (CaseInsensitiveStringEqualsBenchmark_jmhType.tearTrialMutexUpdater.get(l_caseinsensitivestringequalsbenchmark0_G) == 1) { TimeUnit.MILLISECONDS.sleep(l_caseinsensitivestringequalsbenchmark0_G_backoff); l_caseinsensitivestringequalsbenchmark0_G_backoff = Math.max(1024, l_caseinsensitivestringequalsbenchmark0_G_backoff * 2);
private void startThread() { if (state == ST_NOT_STARTED) { if (STATE_UPDATER.compareAndSet(this, ST_NOT_STARTED, ST_STARTED)) { try { doStartThread(); } catch (Throwable cause) { STATE_UPDATER.set(this, ST_NOT_STARTED); PlatformDependent.throwException(cause); } } } }
if (!WORKER_STATE_UPDATER.compareAndSet(this, WORKER_STATE_STARTED, WORKER_STATE_SHUTDOWN)) { if (WORKER_STATE_UPDATER.getAndSet(this, WORKER_STATE_SHUTDOWN) != WORKER_STATE_SHUTDOWN) { INSTANCE_COUNTER.decrementAndGet();
@Override public boolean isStop() { return WORKER_STATE_SHUTDOWN == WORKER_STATE_UPDATER.get(this); }
public final int decrementAndGet() { return indexUpdater.decrementAndGet(this) & Integer.MAX_VALUE; }