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 @@ -402,9 +402,7 @@ public boolean stopSpan(AbstractSpan span) {
throw new IllegalStateException("Stopping the unexpected span = " + span);
}

if (checkFinishConditions()) {
finish();
}
finishIf();

return activeSpanStack.isEmpty();
}
Expand All @@ -426,17 +424,16 @@ public boolean stopSpan(AbstractSpan span) {
@Override public void asyncStop(AsyncSpan span) {
asyncSpanCounter.addAndGet(-1);

if (checkFinishConditions()) {
finish();
}
finishIf();
}

private boolean checkFinishConditions() {
private boolean finishIf() {
if (isRunningInAsyncMode) {
asyncFinishLock.lock();
}
try {
if (activeSpanStack.isEmpty() && (!isRunningInAsyncMode || asyncSpanCounter.get() == 0)) {
finish();
return true;
}
} finally {
Expand Down