Concurent instrumentation tests: block thread before starting tracing
Otherwise blocking thread is pretty much useless since we may still
get spans if threads are executed quickly enough.
@@ -31,12 +31,12 @@ public class AsyncChild implements Runnable, Callable {
}
private void runImpl() {
- if (doTraceableWork) {
- asyncChild();
- }
while (blockThread.get()) {
// busy-wait to block thread
}
+ if (doTraceableWork) {
+ asyncChild();
+ }
}
@Trace(operationName = "asyncChild")
