summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2021-01-19 15:24:49 +0000
committerGitHub <noreply@github.com>2021-01-19 17:24:49 +0200
commitd42ea9e88ac5a9cc03e69be905bae81e88327d35 (patch)
treeb1f7c1c3840490550e5e1b5fba753f311ff1a919
parent4985c11bd6ef67a8eb58716f6c2b6b3d96e8538e (diff)
downloadredis-d42ea9e88ac5a9cc03e69be905bae81e88327d35.tar.gz
Removing unnecessary runtime tio_debug checks (#8250)
These statements were dead code.
-rw-r--r--src/networking.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/networking.c b/src/networking.c
index f1c606236..6d5973563 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -3355,8 +3355,6 @@ void processEventsWhileBlocked(void) {
* Threaded I/O
* ========================================================================== */
-int tio_debug = 0;
-
#define IO_THREADS_MAX_NUM 128
#define IO_THREADS_OP_READ 0
#define IO_THREADS_OP_WRITE 1
@@ -3407,8 +3405,6 @@ void *IOThreadMain(void *myid) {
serverAssert(getIOPendingCount(id) != 0);
- if (tio_debug) printf("[%ld] %d to handle\n", id, (int)listLength(io_threads_list[id]));
-
/* Process: note that the main thread will never touch our list
* before we drop the pending count to 0. */
listIter li;
@@ -3426,8 +3422,6 @@ void *IOThreadMain(void *myid) {
}
listEmpty(io_threads_list[id]);
setIOPendingCount(id, 0);
-
- if (tio_debug) printf("[%ld] Done\n", id);
}
}
@@ -3482,8 +3476,6 @@ void killIOThreads(void) {
}
void startThreadedIO(void) {
- if (tio_debug) { printf("S"); fflush(stdout); }
- if (tio_debug) printf("--- STARTING THREADED IO ---\n");
serverAssert(server.io_threads_active == 0);
for (int j = 1; j < server.io_threads_num; j++)
pthread_mutex_unlock(&io_threads_mutex[j]);
@@ -3494,10 +3486,6 @@ void stopThreadedIO(void) {
/* We may have still clients with pending reads when this function
* is called: handle them before stopping the threads. */
handleClientsWithPendingReadsUsingThreads();
- if (tio_debug) { printf("E"); fflush(stdout); }
- if (tio_debug) printf("--- STOPPING THREADED IO [R%d] [W%d] ---\n",
- (int) listLength(server.clients_pending_read),
- (int) listLength(server.clients_pending_write));
serverAssert(server.io_threads_active == 1);
for (int j = 1; j < server.io_threads_num; j++)
pthread_mutex_lock(&io_threads_mutex[j]);
@@ -3540,8 +3528,6 @@ int handleClientsWithPendingWritesUsingThreads(void) {
/* Start threads if needed. */
if (!server.io_threads_active) startThreadedIO();
- if (tio_debug) printf("%d TOTAL WRITE pending clients\n", processed);
-
/* Distribute the clients across N different lists. */
listIter li;
listNode *ln;
@@ -3586,7 +3572,6 @@ int handleClientsWithPendingWritesUsingThreads(void) {
pending += getIOPendingCount(j);
if (pending == 0) break;
}
- if (tio_debug) printf("I/O WRITE All threads finshed\n");
/* Run the list of clients again to install the write handler where
* needed. */
@@ -3639,8 +3624,6 @@ int handleClientsWithPendingReadsUsingThreads(void) {
int processed = listLength(server.clients_pending_read);
if (processed == 0) return 0;
- if (tio_debug) printf("%d TOTAL READ pending clients\n", processed);
-
/* Distribute the clients across N different lists. */
listIter li;
listNode *ln;
@@ -3676,7 +3659,6 @@ int handleClientsWithPendingReadsUsingThreads(void) {
pending += getIOPendingCount(j);
if (pending == 0) break;
}
- if (tio_debug) printf("I/O READ All threads finshed\n");
/* Run the list of clients again to process the new buffers. */
while(listLength(server.clients_pending_read)) {