aboutsummaryrefslogtreecommitdiff
path: root/Foundation/GTMSignalHandler.h
diff options
context:
space:
mode:
authorGravatar dmaclach <dmaclach@gmail.com>2018-11-13 11:14:18 -0800
committerGravatar GitHub <noreply@github.com>2018-11-13 11:14:18 -0800
commit5023c1cabeecfae4d3124f043b1543ecac7e4d4f (patch)
tree62b8fb781a5ea2322a145628b24f1c3073142a7f /Foundation/GTMSignalHandler.h
parent84a312f5b53a73e77148428284d1a17d0eacf074 (diff)
Fixed up GTMSignalHandler and deprecated it. (#192)
This gets GTMSignalHandler working with libdispatch, and also marks it as deprecated because it is probably easier just to write your own version to call a block instead of the method invocation here. This also makes the tests run again which hasn't been happening for a long time AFAICT.
Diffstat (limited to 'Foundation/GTMSignalHandler.h')
-rw-r--r--Foundation/GTMSignalHandler.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/Foundation/GTMSignalHandler.h b/Foundation/GTMSignalHandler.h
index 5f4b028..eec0e24 100644
--- a/Foundation/GTMSignalHandler.h
+++ b/Foundation/GTMSignalHandler.h
@@ -23,7 +23,7 @@
//
// This is a very simple, easy-to-use class for registering handlers that get
// called when a specific signal is delivered. Also handy for ignoring
-// inconvenient signals. Ignoring SIGKILL is not support for what should be
+// inconvenient signals. Ignoring SIGKILL is not supported for what should be
// obvious reasons. You can pass nil for target & action to ignore the signal.
//
// Example of how to catch SIGABRT and SIGTERM while ignring SIGWINCH:
@@ -53,16 +53,15 @@
//
// Multiple handlers for the same signal is NOT supported.
//
-// kqueue() is used to handle the signals, and the default runloop for the first
-// signal handler is used for signal delivery, so keep that in mind when you're
-// using this class. This class explicitly does not handle arbitrary runloops
-// and threading.
-//
+// libdispatch is used to handle the signals. NB that sending a signal
+// from dispatch_get_main_queue will not get caught in a CFRunLoop based run
+// loop.
+// https://openradar.appspot.com/radar?id=5030997057863680
+
+NS_DEPRECATED(10_0, 10_6, 1_0, 4_0, "Use a DISPATCH_SOURCE_TYPE_SIGNAL dispatch source.")
@interface GTMSignalHandler : NSObject {
@private
- int signo_;
- GTM_WEAK id target_;
- SEL action_;
+ dispatch_source_t signalSource_;
}
// Returns a retained signal handler object that will invoke |handler| on the