mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
bio: doFastMemoryTest should try to kill io threads as well.
This commit is contained in:
parent
8b70cb0ef8
commit
f866023399
@ -1583,6 +1583,7 @@ static void killMainThread(void) {
|
|||||||
static void killThreads(void) {
|
static void killThreads(void) {
|
||||||
killMainThread();
|
killMainThread();
|
||||||
bioKillThreads();
|
bioKillThreads();
|
||||||
|
killIOThreads();
|
||||||
}
|
}
|
||||||
|
|
||||||
void doFastMemoryTest(void) {
|
void doFastMemoryTest(void) {
|
||||||
|
@ -3028,6 +3028,23 @@ void initThreadedIO(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void killIOThreads(void) {
|
||||||
|
int err, j;
|
||||||
|
for (j = 0; j < server.io_threads_num; j++) {
|
||||||
|
if (io_threads[j] == pthread_self()) continue;
|
||||||
|
if (io_threads[j] && pthread_cancel(io_threads[j]) == 0) {
|
||||||
|
if ((err = pthread_join(io_threads[j],NULL)) != 0) {
|
||||||
|
serverLog(LL_WARNING,
|
||||||
|
"IO thread(tid:%lu) can not be joined: %s",
|
||||||
|
(unsigned long)io_threads[j], strerror(err));
|
||||||
|
} else {
|
||||||
|
serverLog(LL_WARNING,
|
||||||
|
"IO thread(tid:%lu) terminated",(unsigned long)io_threads[j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void startThreadedIO(void) {
|
void startThreadedIO(void) {
|
||||||
if (tio_debug) { printf("S"); fflush(stdout); }
|
if (tio_debug) { printf("S"); fflush(stdout); }
|
||||||
if (tio_debug) printf("--- STARTING THREADED IO ---\n");
|
if (tio_debug) printf("--- STARTING THREADED IO ---\n");
|
||||||
|
@ -2478,6 +2478,7 @@ void mixDigest(unsigned char *digest, void *ptr, size_t len);
|
|||||||
void xorDigest(unsigned char *digest, void *ptr, size_t len);
|
void xorDigest(unsigned char *digest, void *ptr, size_t len);
|
||||||
int populateCommandTableParseFlags(struct redisCommand *c, char *strflags);
|
int populateCommandTableParseFlags(struct redisCommand *c, char *strflags);
|
||||||
void debugDelay(int usec);
|
void debugDelay(int usec);
|
||||||
|
void killIOThreads(void);
|
||||||
|
|
||||||
/* TLS stuff */
|
/* TLS stuff */
|
||||||
void tlsInit(void);
|
void tlsInit(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user