mirror of
https://gitee.com/wangbin579/cetus.git
synced 2024-12-04 21:08:23 +08:00
Fix cetus_reap related problems
This commit is contained in:
parent
2f2a9d69d0
commit
bc5533b9c0
@ -119,6 +119,8 @@ cetus_master_process_cycle(cetus_cycle_t *cycle)
|
||||
}
|
||||
}
|
||||
|
||||
usleep(100 * 1000);
|
||||
|
||||
if (!cetus_terminate) {
|
||||
chassis_event_loop_t *loop = cycle->event_base;
|
||||
chassis_event_loop(loop);
|
||||
|
@ -372,6 +372,7 @@ cetus_signal_handler(int signo, siginfo_t *siginfo, void *ucontext)
|
||||
break;
|
||||
|
||||
case SIGALRM:
|
||||
g_message("%s: master received SIGALRM:%d", G_STRLOC, signo);
|
||||
cetus_sigalrm = 1;
|
||||
break;
|
||||
|
||||
|
@ -53,6 +53,8 @@
|
||||
#define E_NET_WOULDBLOCK EWOULDBLOCK
|
||||
#endif
|
||||
|
||||
extern sig_atomic_t cetus_reap;
|
||||
|
||||
void
|
||||
chassis_event_add_with_timeout(chassis *chas, struct event *ev, struct timeval *tv)
|
||||
{
|
||||
@ -95,6 +97,10 @@ chassis_event_loop(chassis_event_loop_t *loop)
|
||||
* check once a second if we shall shutdown the proxy
|
||||
*/
|
||||
while (!chassis_is_shutdown()) {
|
||||
if (cetus_reap) {
|
||||
break;
|
||||
}
|
||||
|
||||
struct timeval timeout;
|
||||
int r;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user