Skip to content

Conversation

@srh
Copy link
Contributor

@srh srh commented Feb 20, 2022

#6957 would need to be applied to v2.4.x.

Also, it makes the mistake of avoiding the NOINLINE macros. We have thread locals using the peculiar TLS_... macros because our coroutines can switch POSIX threads and basic thread_local usage could cause the compiler to optimize access to the variables such that a second access is assumed to be on the same thread as the first access. An explanation exists in thread_local.hpp.

So now thread_local.hpp is updated to have TLS_with_get_ref, to support noncopyable thread locals and returning them by reference.

zouyonghao and others added 2 commits February 20, 2022 00:35
The preceding commit removes the NOINLINE protection, which allows
the compiler (not knowing about on_thread_t) to optimize thread
local accesses incorrectly.
@srh srh merged commit 129b253 into rethinkdb:v2.4.x Feb 20, 2022
@srh srh deleted the v24x/zouyonghao-try-fix-memory-leak branch February 20, 2022 09:38
@srh srh mentioned this pull request Feb 20, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants