Harlequin RIP SDK
skinsignal.h File Reference

Platform Ctrl-C handling abstraction. Each platform can have its own implementation of these functions. More...

Typedefs

typedef void(* PKCtrlCHandlerCallback) (void)
 Handler which is called when Ctrl-C has been signaled.
 

Functions

HqBool PKSetCtrlCHandler (PKCtrlCHandlerCallback callback)
 Set the Ctrl-C function handler. More...
 

Detailed Description

Platform Ctrl-C handling abstraction. Each platform can have its own implementation of these functions.

Function Documentation

◆ PKSetCtrlCHandler()

HqBool PKSetCtrlCHandler ( PKCtrlCHandlerCallback  callback)

Set the Ctrl-C function handler.

This function removes any existing signal mask on SIGINT and SIGTERM previously performed using pthread_sigmask() within the calling thread. See HqCatchExceptions().

Typical RIP signal handling ought to be done as follows:

HqCatchExceptions() - block SIGCHLD, SIGINT and SIGTERM Start RIP - creates threads which inherit the signal mask Start all other threads - which continue to inherit the signal mask PKSetCtrlCHandler() - unblock SIGINT and SIGTERM so Ctrl-C handler can be invoked

Parameters
[in]callbackFunction to be called when Ctrl-C has been signaled.
Returns
TRUE on success; FALSE otherwise.