From 3a9a7e21887d913742a9b16d3caae3249dae41db Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 27 Apr 2026 15:15:03 -0400 Subject: [PATCH] libroot/riscv64: Fix TODO about using std::atomic for TLS. As the comment noted, the same is done on x86_64 already. --- src/system/libroot/os/arch/riscv64/tls.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/os/arch/riscv64/tls.cpp b/src/system/libroot/os/arch/riscv64/tls.cpp index 8d50e92ccd..c366330fd7 100644 --- a/src/system/libroot/os/arch/riscv64/tls.cpp +++ b/src/system/libroot/os/arch/riscv64/tls.cpp @@ -1,8 +1,11 @@ /* - * Copyright 2019-2021, Haiku, Inc. All Rights Reserved. + * Copyright 2019-2021, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ + +#include + #include #include "support/TLS.h" @@ -16,8 +19,8 @@ struct tls_index { extern "C" void* __tls_get_addr(struct tls_index* ti); -// TODO: use std::atomic here like x86_64 -static int32 gNextSlot = TLS_FIRST_FREE_SLOT; + +static std::atomic gNextSlot(TLS_FIRST_FREE_SLOT); static inline void**