| 3540 | } |
| 3541 | |
| 3542 | void killIOThreads(void) { |
| 3543 | int err, j; |
| 3544 | for (j = 0; j < server.io_threads_num; j++) { |
| 3545 | if (io_threads[j] == pthread_self()) continue; |
| 3546 | if (io_threads[j] && pthread_cancel(io_threads[j]) == 0) { |
| 3547 | if ((err = pthread_join(io_threads[j],NULL)) != 0) { |
| 3548 | serverLog(LL_WARNING, |
| 3549 | "IO thread(tid:%lu) can not be joined: %s", |
| 3550 | (unsigned long)io_threads[j], strerror(err)); |
| 3551 | } else { |
| 3552 | serverLog(LL_WARNING, |
| 3553 | "IO thread(tid:%lu) terminated",(unsigned long)io_threads[j]); |
| 3554 | } |
| 3555 | } |
| 3556 | } |
| 3557 | } |
| 3558 | |
| 3559 | void startThreadedIO(void) { |
| 3560 | serverAssert(server.io_threads_active == 0); |