https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80881

--- Comment #80 from LIU Hao <lh_mouse at 126 dot com> ---
In libstdc++ <mutex> there is:

```
  /// @cond undocumented
# ifdef _GLIBCXX_HAVE_TLS
  // If TLS is available use thread-local state for the type-erased callable
  // that is being run by std::call_once in the current thread.
  extern __thread void* __once_callable;
  extern __thread void (*__once_call)();
```

On Windows `_tls_index` is a module-specific variable and is not exported.
There is no way to export a `__thread` variable, nor to access it from a
different module.

As native TLS is already an ABI break, here are two possible fixes:

1. Change these to getter/setter functions.
2. Get rid of this hack and call `__cxa_acquire`, `__cxa_abort` and
`__cxa_release` instead.

Reply via email to