1 #include "ace/Sig_Adapter.h"
3 ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Action
&sa
, int sigkey
)
11 ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Event_Handler
*eh
, int sigkey
)
19 ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Handler_Ex sig_func
, int sigkey
)
26 ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Adapter
)
29 ACE_Sig_Adapter::sigkey () const
31 ACE_TRACE ("ACE_Sig_Adapter::sigkey");
36 ACE_Sig_Adapter::handle_signal (int signum
, siginfo_t
*siginfo
, ucontext_t
*ucontext
)
38 ACE_TRACE ("ACE_Sig_Adapter::handle_signal");
44 // We have to dispatch a handler that was registered by a
45 // third-party library.
46 ACE_Sig_Action old_disp
;
48 // Make sure this handler executes in the context it was
50 this->sa_
.register_action (signum
, &old_disp
);
52 ACE_SignalHandler sig_handler
= this->sa_
.handler ();
53 ACE_Sig_Handler_Ex sig_func
= reinterpret_cast<ACE_Sig_Handler_Ex
> (reinterpret_cast<void*> (sig_handler
));
55 (*sig_func
) (signum
, siginfo
, ucontext
);
56 // Restore the original disposition.
57 old_disp
.register_action (signum
);
61 this->eh_
->handle_signal (signum
, siginfo
, ucontext
);
64 (*this->sig_func_
) (signum
, siginfo
, ucontext
);