diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/initservice/istepdispatcherif.H | 8 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 20 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 7 |
3 files changed, 35 insertions, 0 deletions
diff --git a/src/include/usr/initservice/istepdispatcherif.H b/src/include/usr/initservice/istepdispatcherif.H index 2d2b2b2d8..1f2fad442 100644 --- a/src/include/usr/initservice/istepdispatcherif.H +++ b/src/include/usr/initservice/istepdispatcherif.H @@ -58,6 +58,14 @@ errlHndl_t sendSyncPoint ( void ); */ errlHndl_t sendIstepCompleteMsg ( void ); +/** + * @brief This function is to be used by external code to check whether + * a shutdown has been requested + * + * @return bool - true if shutdown requested, false if not + */ +bool isShutdownRequested ( void ); + } #endif diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index 90007d6fe..f67b39bbd 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -1079,6 +1079,21 @@ void IStepDispatcher::iStepBreakPoint(uint32_t i_info) } // ---------------------------------------------------------------------------- +// IStepDispatcher::isShutdownRequested() +// ---------------------------------------------------------------------------- +bool IStepDispatcher::isShutdownRequested() +{ + TRACFCOMP(g_trac_initsvc, ENTER_MRK"IStepDispatcher::isShutdownRequested"); + + mutex_lock(&iv_mutex); + bool isShutdownRequested = iv_shutdown; + mutex_unlock(&iv_mutex); + + TRACFCOMP(g_trac_initsvc, EXIT_MRK"IStepDispatcher::isShutdownRequested"); + return isShutdownRequested; +} + +// ---------------------------------------------------------------------------- // IStepDispatcher::handleIStepRequestMsg() // ---------------------------------------------------------------------------- void IStepDispatcher::handleIStepRequestMsg(msg_t * & io_pMsg) @@ -1464,6 +1479,11 @@ void iStepBreakPoint(uint32_t i_info) IStepDispatcher::getTheInstance().iStepBreakPoint( i_info ); } +bool isShutdownRequested() +{ + return IStepDispatcher::getTheInstance().isShutdownRequested(); +} + // ---------------------------------------------------------------------------- // IStepDispatcher::getIstepInfo() // ---------------------------------------------------------------------------- diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index 2cd8000da..de235cc7e 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -163,6 +163,13 @@ public: void getIstepInfo ( uint8_t & o_iStep, uint8_t & o_subStep ); + /** + * @brief This function determines if a shutdown was requested or not + * + * @return bool - true if shutdown requested, false if not + */ + bool isShutdownRequested(); + protected: /** |