summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e939e15)
raw | patch | inline | side by side (parent: e939e15)
author | vwan@ti.com <vwan@ti.com> | |
Fri, 18 Oct 2013 18:39:46 +0000 (11:39 -0700) | ||
committer | Chris Ring <cring@ti.com> | |
Mon, 21 Oct 2013 00:47:50 +0000 (17:47 -0700) |
This commit ensures that SIGTERM is caught by the main thread by masking off signal
handling in the other threads of the thread pool. This allows the IPC resource
manager to terminate correctly after MessageQ is used (SDOCM00102268).
Signed-off-by: VW <vwan@ti.com>
handling in the other threads of the thread pool. This allows the IPC resource
manager to terminate correctly after MessageQ is used (SDOCM00102268).
Signed-off-by: VW <vwan@ti.com>
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c | patch | blob | history |
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
index fac2ec9fbadfeec6149f598d259d527699cdaf37..f8ac7c0051799391d2b4717f8c8d51faf6aedc64 100644 (file)
return(-1);
}
+ /*
+ * Mask out all signals before creating a thread pool.
+ * This prevents other threads in the thread pool
+ * from intercepting signals such as SIGTERM.
+ */
+ sigfillset(&set);
+ pthread_sigmask(SIG_BLOCK, &set, NULL);
+
/* Initialize the thread pool */
memset (&tattr, 0x00, sizeof (thread_pool_attr_t));
tattr.handle = dev->dpp;
trace_active = FALSE;
}
- /* Mask out unnecessary signals */
- sigfillset (&set);
+ /* Unmask signals to be caught */
sigdelset (&set, SIGINT);
sigdelset (&set, SIGTERM);
pthread_sigmask (SIG_BLOCK, &set, NULL);