Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ea4bf91a
Commit
ea4bf91a
authored
Sep 16, 2020
by
WuYunlong
Committed by
Oran Agra
Oct 27, 2020
Browse files
bio: doFastMemoryTest should try to kill io threads as well.
(cherry picked from commit
f8660233
)
parent
5d933226
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
ea4bf91a
...
...
@@ -1530,6 +1530,7 @@ static void killMainThread(void) {
static void killThreads(void) {
killMainThread();
bioKillThreads();
killIOThreads();
}
/* Scans the (assumed) x86 code starting at addr, for a max of `len`
...
...
src/networking.c
View file @
ea4bf91a
...
...
@@ -3021,6 +3021,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) {
if (tio_debug) { printf("S"); fflush(stdout); }
if (tio_debug) printf("--- STARTING THREADED IO ---\n");
...
...
src/server.h
View file @
ea4bf91a
...
...
@@ -2460,6 +2460,7 @@ int memtest_preserving_test(unsigned long *m, size_t bytes, int passes);
void
mixDigest
(
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
);
void
killIOThreads
(
void
);
/* TLS stuff */
void
tlsInit
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment