From 0fd8019149dc006036c3cd4057becf429160fb5d Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 11 Feb 2020 12:17:59 -0800 Subject: [PATCH] ircd::ctx: Use thread_local keyword for current. --- include/ircd/ctx/this_ctx.h | 2 +- ircd/ctx.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/ircd/ctx/this_ctx.h b/include/ircd/ctx/this_ctx.h index ef53ad8b4..389f166c1 100644 --- a/include/ircd/ctx/this_ctx.h +++ b/include/ircd/ctx/this_ctx.h @@ -44,7 +44,7 @@ inline namespace this_ctx namespace ircd::ctx { /// Points to the currently running context or null for main stack (do not modify) - extern __thread ctx *current; + extern thread_local ctx *current; } namespace ircd diff --git a/ircd/ctx.cc b/ircd/ctx.cc index bbb459ed8..ee8549b10 100644 --- a/ircd/ctx.cc +++ b/ircd/ctx.cc @@ -687,7 +687,8 @@ noexcept // // set by the continuation object and the base frame. -__thread ircd::ctx::ctx * +thread_local +ircd::ctx::ctx * ircd::ctx::current; /// Yield the currently running context until `time_point` ignoring notes