File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
src/main/java/org/truffleruby Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 78
78
import org .truffleruby .options .Options ;
79
79
import org .truffleruby .parser .TranslatorDriver ;
80
80
import org .truffleruby .platform .NativeConfiguration ;
81
+ import org .truffleruby .platform .Signals ;
81
82
import org .truffleruby .platform .TruffleNFIPlatform ;
82
83
import org .truffleruby .shared .Metrics ;
83
84
import org .truffleruby .shared .TruffleRuby ;
@@ -518,6 +519,8 @@ private void dispose() {
518
519
threadManager .cleanupMainThread ();
519
520
safepointManager .checkNoRunningThreads ();
520
521
522
+ Signals .restoreDefaultHandlers ();
523
+
521
524
if (options .ROPE_PRINT_INTERN_STATS ) {
522
525
RubyLanguage .LOGGER .info ("ropes re-used: " + language .ropeCache .getRopesReusedCount ());
523
526
RubyLanguage .LOGGER .info ("rope byte arrays re-used: " + language .ropeCache .getByteArrayReusedCount ());
Original file line number Diff line number Diff line change @@ -534,7 +534,6 @@ UnblockingAction getNativeCallUnblockingAction() {
534
534
}
535
535
536
536
public void initializeValuesForJavaThread (RubyThread rubyThread , Thread thread ) {
537
-
538
537
if (Thread .currentThread () == thread ) {
539
538
currentThread .set (rubyThread );
540
539
}
@@ -557,6 +556,10 @@ public void cleanupValuesForJavaThread(Thread thread) {
557
556
}
558
557
foreignThreadMap .remove (thread );
559
558
559
+ if (pthread_self != null ) {
560
+ blockingNativeCallUnblockingAction .remove ();
561
+ }
562
+
560
563
unblockingActions .remove (thread );
561
564
}
562
565
Original file line number Diff line number Diff line change 9
9
*/
10
10
package org .truffleruby .platform ;
11
11
12
+ import java .util .ArrayList ;
12
13
import java .util .concurrent .ConcurrentHashMap ;
13
14
import java .util .concurrent .ConcurrentMap ;
14
15
@@ -33,7 +34,7 @@ public static void registerIgnoreHandler(String signalName) {
33
34
}
34
35
35
36
public static boolean restoreDefaultHandler (String signalName ) {
36
- final SignalHandler defaultHandler = Signals . DEFAULT_HANDLERS .get (signalName );
37
+ final SignalHandler defaultHandler = DEFAULT_HANDLERS .get (signalName );
37
38
if (defaultHandler == null ) {
38
39
// it is already the default signal
39
40
return false ;
@@ -49,4 +50,10 @@ public static void restoreSystemHandler(String signalName) {
49
50
Signal .handle (signal , SignalHandler .SIG_DFL );
50
51
}
51
52
53
+ public static void restoreDefaultHandlers () {
54
+ for (String signalName : new ArrayList <>(DEFAULT_HANDLERS .keySet ())) {
55
+ restoreDefaultHandler (signalName );
56
+ }
57
+ }
58
+
52
59
}
You can’t perform that action at this time.
0 commit comments