Skip to content
Newer
Older
100644 42 lines (31 sloc) 755 Bytes
07fc27b Hook up signal delivery
Evan Phoenix authored
1 #ifndef RBX_SIGNAL_HPP
2 #define RBX_SIGNAL_HPP
3
4 #include "util/thread.hpp"
4147f9a Add locking to SignalHandler
Evan Phoenix authored
5 #include "lock.hpp"
07fc27b Hook up signal delivery
Evan Phoenix authored
6
7 #include <list>
8
9 namespace rubinius {
10 class VM;
6f92669 @dbussink Initial work to enable compiling with clang
dbussink authored
11 struct CallFrame;
07fc27b Hook up signal delivery
Evan Phoenix authored
12
4147f9a Add locking to SignalHandler
Evan Phoenix authored
13 class SignalHandler : public thread::Thread, Lockable {
07fc27b Hook up signal delivery
Evan Phoenix authored
14 VM* vm_;
e4c92f8 Rework how signals are delivered. Fixes #356
Evan Phoenix authored
15 int pending_signals_[NSIG];
16 int queued_signals_;
17 bool executing_signal_;
07fc27b Hook up signal delivery
Evan Phoenix authored
18 thread::SpinLock lock_;
e4c92f8 Rework how signals are delivered. Fixes #356
Evan Phoenix authored
19 int read_fd_;
20 int write_fd_;
5a2ce08 Shutdown the signal handler thread before exec'ing
Evan Phoenix authored
21 bool exit_;
e6bb96a Fix a number of IO/Signal interaction issues
Evan Phoenix authored
22
23 public:
24 SignalHandler(VM* vm);
e4c92f8 Rework how signals are delivered. Fixes #356
Evan Phoenix authored
25
26 void perform();
27
4147f9a Add locking to SignalHandler
Evan Phoenix authored
28 void add_signal(VM*, int sig, bool def=false);
e6bb96a Fix a number of IO/Signal interaction issues
Evan Phoenix authored
29 void handle_signal(int sig);
30 static void signal_tramp(int sig);
31
6e7c8e8 @dbussink Fix signal handling
dbussink authored
32 bool deliver_signals(CallFrame* call_frame);
e4c92f8 Rework how signals are delivered. Fixes #356
Evan Phoenix authored
33
ad006cb Fix ugly signal bug related to pipe fds.
Evan Phoenix authored
34 void reopen_pipes();
e4c92f8 Rework how signals are delivered. Fixes #356
Evan Phoenix authored
35 static void on_fork();
5a2ce08 Shutdown the signal handler thread before exec'ing
Evan Phoenix authored
36 static void shutdown();
37 void shutdown_i();
07fc27b Hook up signal delivery
Evan Phoenix authored
38 };
39 }
40
41 #endif
Something went wrong with that request. Please try again.