add global var to indicate server shutdown requests

This commit is contained in:
Dietmar Maurer committed 2019-04-01 12:05:11 +02:00
1 parent 3e6a7deeaa
commit 9136f857cc
2 files changed
+17 -2

No files matched your search

+12
View File
@@ -545,3 +545,15 @@ pub fn fd_change_cloexec(fd: RawFd, on: bool) -> Result<(), Error> {
fcntl(fd, F_SETFD(flags))?;
Ok(())
}
static mut SHUTDOWN_REQUESTED: bool = false;
pub fn request_shutdown() {
unsafe { SHUTDOWN_REQUESTED = true; }
}
#[inline(always)]
pub fn shutdown_requested() -> bool {
unsafe { SHUTDOWN_REQUESTED }
}