| 1925 | #endif /* HAVE_PROC_MAPS */ |
| 1926 | |
| 1927 | static void killServerThreads(void) { |
| 1928 | int err; |
| 1929 | for (int i = 0; i < cserver.cthreads; i++) { |
| 1930 | if (g_pserver->rgthread[i] != pthread_self()) { |
| 1931 | pthread_cancel(g_pserver->rgthread[i]); |
| 1932 | } |
| 1933 | } |
| 1934 | if (pthread_self() != cserver.main_thread_id && pthread_cancel(cserver.main_thread_id) == 0) { |
| 1935 | if ((err = pthread_join(cserver.main_thread_id,NULL)) != 0) { |
| 1936 | serverLog(LL_WARNING, "main thread can not be joined: %s", strerror(err)); |
| 1937 | } else { |
| 1938 | serverLog(LL_WARNING, "main thread terminated"); |
| 1939 | } |
| 1940 | } |
| 1941 | } |
| 1942 | |
| 1943 | /* Kill the running threads (other than current) in an unclean way. This function |
| 1944 | * should be used only when it's critical to stop the threads for some reason. |
no test coverage detected