Platforms to show: All Mac Windows Linux Cross-Platform
Back to SignalHandlerMBS class.
SignalHandlerMBS.alarm(seconds as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 8.5 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
The alarm() function sets a timer to deliver the signal SIGALRM to the calling process after the specified number of seconds. If an alarm has already been set with alarm() but has not been delivered, another call to alarm() will supersede the prior call. The request alarm(0) voids the current alarm and the signal SIGALRM will not be delivered.
Due to setitimer restriction the maximum number of seconds allowed is 100000000.
alarm sends signal 14 after the time out.
SignalHandlerMBS.ClearFlag(signalIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please call this after you got IsFlagSet.
Some examples using this method:
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
SignalHandlerMBS.ClearStacktrace(signalIndex as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.2 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Some examples using this method:
SignalHandlerMBS.IsFlagSet(signalIndex as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
SignalHandlerMBS.QueryStacktrace(signalIndex as Integer, skip as Integer = 2) as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.2 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Useful to know later which code got the signal.
Works for flag handlers and for the event handlers if enabled.
Some examples using this method:
SignalHandlerMBS.SendSignal(PID as Integer, Signal as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 11.0 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns true on success and false on failure.
Without a signal handler the target app could quit.
Lookup signal.h for the list of signals. They can be different on Mac and Linux.
SignalHandlerMBS.SendSignalToSelf(Signal as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 11.0 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns true on success and false on failure.
Without a signal handler the target app could quit.
SignalHandlerMBS.SetDefaultHandler(signalIndex as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 8.5 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns true on success and false on failure.
Some examples using this method:
SignalHandlerMBS.SetFlagHandler(signalIndex as Integer, CollectStackTrace as boolean = false) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 14.0 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns true on success and false on failure.
Please use IsFlagSet in your app regularly to check if the flag was set.
If CollectStackTrace is true, you can later use QueryStacktrace to get the stack trace from the time the signal was captured.
Some examples using this method:
SignalHandlerMBS.SetIgnore(signalIndex as Integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 8.5 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns true on success and false on failure.
Some examples using this method:
SignalHandlerMBS.SetPrintBacktraceAndAbortHandler(signalIndex as integer) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 24.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The signal is handled by the plugin. We print the backtrace and abort.
We write details to a crash.txt file in the current folder.
SignalHandlerMBS.SignalStatus(signalIndex as Integer) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | System | MBS Util Plugin | 8.5 | ✅ Yes | ❌ No | ✅ Yes | ✅ Yes | All |
Returns 0 (unknown), kSignalDefault, kSignalEvent, kSignalFlag or kSignalIgnored.
The items on this page are in the following plugins: MBS Util Plugin.
