MCPcopy Create free account
hub / github.com/F-Stack/f-stack / killMainThread

Function killMainThread

app/redis-6.2.6/src/debug.c:1709–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1707#endif /* HAVE_PROC_MAPS */
1708
1709static 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.

Callers 1

killThreadsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected