File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1750,15 +1750,24 @@ private void joinThreads() {
17501750 int tries = isOurThread ? 100 : 5 ;
17511751 for (int i = 0 ; i < tries && thread .isAlive (); i ++) {
17521752 thread .join (tries - i );
1753+ if (!thread .isAlive ()) {
1754+ break ;
1755+ }
1756+ LOGGER .fine ("Trying to join " + thread .getName () + " failed after " + (tries - i ) + "ms." );
1757+ if (isOurThread ) {
1758+ thread .interrupt ();
1759+ thread .join (tries - i );
1760+ if (!thread .isAlive ()) {
1761+ break ;
1762+ }
1763+ LOGGER .fine ("Trying to interrupt our " + thread .getName () + " failed after " + (tries - i ) + "ms." );
1764+ }
17531765 env .submitThreadLocal (new Thread []{thread }, new ThreadLocalAction (true , false ) {
17541766 @ Override
17551767 protected void perform (ThreadLocalAction .Access access ) {
17561768 throw new PythonThreadKillException ();
17571769 }
17581770 });
1759- if (isOurThread ) {
1760- thread .interrupt ();
1761- }
17621771 }
17631772 if (isOurThread ) {
17641773 // Thread#stop is not supported on SVM
You can’t perform that action at this time.
0 commit comments