| 1707 | #endif /* HAVE_PROC_MAPS */ |
| 1708 | |
| 1709 | static void killMainThread(void) { |
| 1710 | int err; |
| 1711 | if (pthread_self() != server.main_thread_id && pthread_cancel(server.main_thread_id) == 0) { |
| 1712 | if ((err = pthread_join(server.main_thread_id,NULL)) != 0) { |
| 1713 | serverLog(LL_WARNING, "main thread can not be joined: %s", strerror(err)); |
| 1714 | } else { |
| 1715 | serverLog(LL_WARNING, "main thread terminated"); |
| 1716 | } |
| 1717 | } |
| 1718 | } |
| 1719 | |
| 1720 | /* Kill the running threads (other than current) in an unclean way. This function |
| 1721 | * should be used only when it's critical to stop the threads for some reason. |