Skip to content
Merged
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 @@ -291,9 +291,11 @@ boolean isLockedForCollect() {
}

/** Locks new-series creation and waits for any in-flight new-series operations to complete. */
@SuppressWarnings("ThreadPriorityCheck")
void lockForCollectAndAwait() {
int s = newSeriesGate.addAndGet(1);
while (s != 1) {
Thread.yield();
s = newSeriesGate.get();
}
}
Expand Down Expand Up @@ -350,8 +352,11 @@ void lockForCollect() {
}

/** Waits for all in-flight recorders to finish, then clears the collection lock. */
@SuppressWarnings("ThreadPriorityCheck")
void awaitRecordersAndUnlock() {
while (state.get() > 1) {}
while (state.get() > 1) {
Thread.yield();
}
state.addAndGet(-1);
}
}
Expand Down