Skip to content

Commit

Permalink
Merge pull request #1511 from cloudflare/kenton/no-kj-threadlocal
Browse files Browse the repository at this point in the history
Change KJ_THREADLOCAL_PTR to thread_local.
  • Loading branch information
kentonv authored Dec 27, 2023
2 parents ac11af5 + 161f1ea commit fd57d72
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/workerd/io/io-context.c++
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "io-context.h"
#include <workerd/io/io-gate.h>
#include <workerd/io/worker.h>
#include <kj/threadlocal.h>
#include <kj/debug.h>
#include <workerd/jsg/jsg.h>
#include <workerd/util/sentry.h>
Expand All @@ -14,8 +13,8 @@

namespace workerd {

KJ_THREADLOCAL_PTR(IoContext) threadLocalRequest = nullptr;
KJ_THREADLOCAL_PTR(void) threadId = nullptr;
static thread_local IoContext* threadLocalRequest = nullptr;
static thread_local void* threadId = nullptr;

static void* getThreadId() {
if (threadId == nullptr) threadId = new int;
Expand Down

0 comments on commit fd57d72

Please sign in to comment.