This function was a bit clever, reusing threadlocal_push_context and ignoring the return value. By inlining the code we can make it simpler to understand and probably do less work. Updates: commit fc0c0830 ("threadlocal: Add way to store current context") --- server/threadlocal.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/threadlocal.c b/server/threadlocal.c index 2ace6009b..784a08361 100644 --- a/server/threadlocal.c +++ b/server/threadlocal.c @@ -258,5 +258,8 @@ threadlocal_push_context (struct context *ctx) void threadlocal_pop_context (struct context **ctx) { - threadlocal_push_context (*ctx); + struct threadlocal *threadlocal = pthread_getspecific (threadlocal_key); + + if (threadlocal) + threadlocal->ctx = *ctx; } -- 2.42.0