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

Function bioKillThreads

app/redis-6.2.6/src/bio.c:293–309  ·  view source on GitHub ↗

Kill the running bio threads in an unclean way. This function should be * used only when it's critical to stop the threads for some reason. * Currently Redis does this only on crash (for instance on SIGSEGV) in order * to perform a fast memory check without other threads messing with memory. */

Source from the content-addressed store, hash-verified

291 * Currently Redis does this only on crash (for instance on SIGSEGV) in order
292 * to perform a fast memory check without other threads messing with memory. */
293void bioKillThreads(void) {
294 int err, j;
295
296 for (j = 0; j < BIO_NUM_OPS; j++) {
297 if (bio_threads[j] == pthread_self()) continue;
298 if (bio_threads[j] && pthread_cancel(bio_threads[j]) == 0) {
299 if ((err = pthread_join(bio_threads[j],NULL)) != 0) {
300 serverLog(LL_WARNING,
301 "Bio thread for job type #%d can not be joined: %s",
302 j, strerror(err));
303 } else {
304 serverLog(LL_WARNING,
305 "Bio thread for job type #%d terminated",j);
306 }
307 }
308 }
309}

Callers 1

killThreadsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected