Ejemplo n.º 1
0
static void* Thread2(void* context)
{
    le_sig_SetEventHandler(SIGUSR2, SigUser2Handler);

    le_event_RunLoop();

    return NULL;
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------------------------------
void exec_Init
(
    void
)
//--------------------------------------------------------------------------------------------------
{
    le_sig_Block(SIGCHLD);
    le_sig_SetEventHandler(SIGCHLD, OnChildSignal);
}
Ejemplo n.º 3
0
//--------------------------------------------------------------------------------------------------
static void StartDeferral
(
    void
)
{
    le_updateCtrl_ConnectService();
    // Setup the signal event handler before we do Defer. This way, even if we get signalled
    // before Defer gets done we won't deal with the signal until the next time round the
    // event loop - so our Defer and Allow count will match by the time we exit.
    le_sig_Block(SIGINT);
    le_sig_SetEventHandler(SIGINT, EndDeferral);
    le_sig_Block(SIGTERM);
    le_sig_SetEventHandler(SIGTERM, EndDeferral);

    le_updateCtrl_Defer();
    // Our work is done here. Go wait on the event loop until someone SIGINTs or kills us.
    Done = true;
}
Ejemplo n.º 4
0
static void* Thread1(void* context)
{
    delEvent = le_event_CreateId("DeleteSigs", 0);
    le_event_AddHandler("DelSigHandler", delEvent, DeleteSigs);

    le_sig_SetEventHandler(SIGUSR1, SigUser1Handler);

    // Start the test procedure by sending a SIGUSR1 signal to our own process.
    checkCount++;
    LE_ASSERT(kill(getpid(), SIGUSR1) == 0);

    le_event_RunLoop();

    return NULL;
}