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() {
1750
1750
int tries = isOurThread ? 100 : 5 ;
1751
1751
for (int i = 0 ; i < tries && thread .isAlive (); i ++) {
1752
1752
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
+ }
1753
1765
env .submitThreadLocal (new Thread []{thread }, new ThreadLocalAction (true , false ) {
1754
1766
@ Override
1755
1767
protected void perform (ThreadLocalAction .Access access ) {
1756
1768
throw new PythonThreadKillException ();
1757
1769
}
1758
1770
});
1759
- if (isOurThread ) {
1760
- thread .interrupt ();
1761
- }
1762
1771
}
1763
1772
if (isOurThread ) {
1764
1773
// Thread#stop is not supported on SVM
You can’t perform that action at this time.
0 commit comments