forked from irods/irods
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
squash. Implemented graceful shutdown of agent factory and agents. TO…
…DO: Make SSL socket logic handle graceful shutdown.
- Loading branch information
1 parent
9328578
commit d9679da
Showing
5 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef IRODS_AGENT_GLOBALS_HPP | ||
#define IRODS_AGENT_GLOBALS_HPP | ||
|
||
// Globals aren't the best, but given that C++17 supports initialization | ||
// of global variable across translation units without violating ODR, it | ||
// is okay to define globals for the agent factory here. | ||
// | ||
// With that said, let's keep this to a minimum. Defining global variables | ||
// in this file should be a last resort. | ||
|
||
#include <csignal> | ||
|
||
// This global is the flag which allows agents to gracefully react to | ||
// stop instructions from the agent factory. | ||
// | ||
// It is set by signal handlers defined by the agent factory and MUST NOT | ||
// be used for anything else. | ||
// | ||
// Low-level systems which need to react to stop instructions should include | ||
// this file and check this flag. | ||
inline volatile std::sig_atomic_t g_terminate = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) | ||
|
||
#endif // IRODS_AGENT_GLOBALS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters