Improve shutdown signal safeness
The signal handler no longer acquires the service list lock which removes a number of deadlock possibilities from the shutdown process. Instead, a global shutdown flag is set that serves the same purpose as the individual service shutdown flags did.
This commit is contained in:
@ -171,6 +171,9 @@ typedef enum count_spec_t
|
||||
#define SERVICE_STATE_FAILED 3 /**< The service failed to start */
|
||||
#define SERVICE_STATE_STOPPED 4 /**< The service has been stopped */
|
||||
|
||||
// Set to 1 when services should stop
|
||||
extern volatile sig_atomic_t service_should_stop;
|
||||
|
||||
/**
|
||||
* Find a service
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user