File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Sources/SignalHandling/DelayedSigaction Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,23 @@ public enum SigactionDelayer_Block {
127127 }
128128 }
129129
130+ /**
131+ Convenience to unregister a set of delayed sigactions in one function call.
132+
133+ All of the delayed sigaction will be attempted to be unregistered. Errors
134+ will be returned. The function is successful if the returned dictionary is
135+ empty. */
136+ public static func unregisterDelayedSigactions( _ delayedSigactions: Set < DelayedSigaction > ) -> [ DelayedSigaction : Error ] {
137+ return signalProcessingQueue. sync {
138+ var ret = [ DelayedSigaction: Error] ( )
139+ for delayedSigaction in delayedSigactions {
140+ do { try Self . unregisterDelayedSigactionOnQueue ( delayedSigaction) }
141+ catch { ret [ delayedSigaction] = error}
142+ }
143+ return ret
144+ }
145+ }
146+
130147 /* ***************
131148 MARK: - Private
132149 *************** */
Original file line number Diff line number Diff line change @@ -64,6 +64,23 @@ public enum SigactionDelayer_Unsig {
6464 }
6565 }
6666
67+ /**
68+ Convenience to unregister a set of delayed sigactions in one function call.
69+
70+ All of the delayed sigaction will be attempted to be unregistered. Errors
71+ will be returned. The function is successful if the returned dictionary is
72+ empty. */
73+ public static func unregisterDelayedSigactions( _ delayedSigactions: Set < DelayedSigaction > ) -> [ DelayedSigaction : Error ] {
74+ return signalProcessingQueue. sync {
75+ var ret = [ DelayedSigaction: Error] ( )
76+ for delayedSigaction in delayedSigactions {
77+ do { try Self . unregisterDelayedSigactionOnQueue ( delayedSigaction) }
78+ catch { ret [ delayedSigaction] = error}
79+ }
80+ return ret
81+ }
82+ }
83+
6784 /**
6885 Change the original sigaction of the given signal if it was registered for an
6986 unsigaction. This is useful if you want to change the sigaction handler after
You can’t perform that action at this time.
0 commit comments