-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use pthread_exit to terminate raft service. (#536)
* Use pthread_exit to terminate raft service. Allow the process to handle termination of raft service rather than force process wide `exit()`. This is compile time configurable during CMake configuration. Addresses #535 --------- Co-authored-by: Jung-Sang Ahn <[email protected]>
- Loading branch information
1 parent
ea1385e
commit 6741a45
Showing
6 changed files
with
43 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
// What should be called to shutdown when raft_server is in abnormal state | ||
#ifdef USE_PTHREAD_EXIT | ||
extern "C" { | ||
#include <pthread.h> | ||
} | ||
#define _sys_exit(status) ::pthread_exit(nullptr) | ||
|
||
#else | ||
|
||
#include <cstdlib> | ||
#define _sys_exit(status) ::exit((status)) | ||
|
||
#endif |
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
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