File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
plugin/src/main/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 7070import org .jenkinsci .plugins .workflow .steps .StepExecution ;
7171import org .jenkinsci .plugins .workflow .support .concurrent .Futures ;
7272import org .jenkinsci .plugins .workflow .support .concurrent .Timeout ;
73+ import org .jenkinsci .plugins .workflow .support .concurrent .WithThreadName ;
7374import org .jenkinsci .plugins .workflow .support .pickles .serialization .PickleResolver ;
7475import org .jenkinsci .plugins .workflow .support .pickles .serialization .RiverReader ;
7576import org .jenkinsci .plugins .workflow .support .storage .FlowNodeStorage ;
@@ -1990,17 +1991,21 @@ private interface RunnableWithEx<E extends Exception> {
19901991 }
19911992
19921993 private <T , E extends Exception > T withReadLock (@ NonNull SupplierWithEx <T , E > supplier ) throws E {
1993- readWriteLock .readLock ().lock ();
1994- try {
1994+ try (var ignored = new WithThreadName (" acquiring read lock on storage of " + CpsFlowExecution .this )) {
1995+ readWriteLock .readLock ().lock ();
1996+ }
1997+ try (var ignored = new WithThreadName (" with read lock on storage of " + CpsFlowExecution .this )) {
19951998 return supplier .get ();
19961999 } finally {
19972000 readWriteLock .readLock ().unlock ();
19982001 }
19992002 }
20002003
20012004 private <E extends Exception > void withWriteLock (@ NonNull RunnableWithEx <E > runnable ) throws E {
2002- readWriteLock .writeLock ().lock ();
2003- try {
2005+ try (var ignored = new WithThreadName (" acquiring write lock on storage of " + CpsFlowExecution .this )) {
2006+ readWriteLock .writeLock ().lock ();
2007+ }
2008+ try (var ignored = new WithThreadName (" with write lock on storage of " + CpsFlowExecution .this )) {
20042009 runnable .run ();
20052010 } finally {
20062011 readWriteLock .writeLock ().unlock ();
You can’t perform that action at this time.
0 commit comments