version 1.2.2.5, 2012/04/24 08:06:09
|
version 1.2.2.6, 2012/04/24 13:54:50
|
Line 16 pthread_mutex_t mtx_sess, mtx_pub;
|
Line 16 pthread_mutex_t mtx_sess, mtx_pub;
|
FILE *logg; |
FILE *logg; |
extern char compiled[], compiledby[], compilehost[]; |
extern char compiled[], compiledby[], compilehost[]; |
static char szCfgName[MAXPATHLEN]; |
static char szCfgName[MAXPATHLEN]; |
intptr_t Kill; | volatile intptr_t Kill; |
|
|
|
|
static void |
static void |
Line 35 static void
|
Line 35 static void
|
sigHand(int sig) |
sigHand(int sig) |
{ |
{ |
int stat; |
int stat; |
|
struct tagSession *sess; |
|
|
switch (sig) { |
switch (sig) { |
case SIGHUP: |
case SIGHUP: |
Line 48 sigHand(int sig)
|
Line 49 sigHand(int sig)
|
case SIGTERM: |
case SIGTERM: |
ioDEBUG(1, "Terminate MQTT service in progress"); |
ioDEBUG(1, "Terminate MQTT service in progress"); |
Kill++; |
Kill++; |
|
|
|
SESS_LOCK; |
|
TAILQ_FOREACH(sess, &Sessions, sess_node) |
|
if (sess->sess_tid) |
|
pthread_cancel(sess->sess_tid); |
|
SESS_UNLOCK; |
break; |
break; |
case SIGCHLD: |
case SIGCHLD: |
while (waitpid(-1, &stat, WNOHANG) > 0); |
while (waitpid(-1, &stat, WNOHANG) > 0); |