summaryrefslogtreecommitdiff
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-28 19:49:03 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-28 19:49:03 +0200
commite858dce757f8766a29f2151ec3ffef3df85af66b (patch)
tree3d60cd0d5da345aac0c852b166eb04bec91f3632 /sysdep/unix/log.c
parent00f6b162c9c357bddf48d52d08b6abb6010004b6 (diff)
Moved the thread starting code to IO loop code
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index f48588b6..185231e8 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -36,10 +36,10 @@ static FILE *dbgf;
static list *current_log_list;
static char *current_syslog_name; /* NULL -> syslog closed */
-static _Atomic uint max_coro_id = ATOMIC_VAR_INIT(1);
-static _Thread_local uint this_coro_id;
+static _Atomic uint max_thread_id = ATOMIC_VAR_INIT(1);
+static _Thread_local uint this_thread_id;
-#define THIS_CORO_ID (this_coro_id ?: (this_coro_id = atomic_fetch_add_explicit(&max_coro_id, 1, memory_order_acq_rel)))
+#define THIS_THREAD_ID (this_thread_id ?: (this_thread_id = atomic_fetch_add_explicit(&max_thread_id, 1, memory_order_acq_rel)))
#include <pthread.h>
@@ -183,7 +183,7 @@ log_commit(int class, buffer *buf)
l->pos += msg_len;
}
- fprintf(l->fh, "%s [%04x] <%s> ", tbuf, THIS_CORO_ID, class_names[class]);
+ fprintf(l->fh, "%s [%04x] <%s> ", tbuf, THIS_THREAD_ID, class_names[class]);
}
fputs(buf->start, l->fh);
fputc('\n', l->fh);
@@ -329,7 +329,7 @@ debug(const char *msg, ...)
sec = dbg_time.tv_sec - dbg_time_start.tv_sec - 1;
}
- int n = bsnprintf(pos, max, "%u.%09u: [%04x] ", sec, nsec, THIS_CORO_ID);
+ int n = bsnprintf(pos, max, "%u.%09u: [%04x] ", sec, nsec, THIS_THREAD_ID);
pos += n;
max -= n;