Commit Graph

3 Commits

Author SHA1 Message Date
Mike Ash
190d3fd22e [Concurrency] Use pthread_specific for thread-local storage on Darwin.
The pthread_specific APIs are better than C++ thread_local storage on Darwin since we can use Swift's reserved pthread keys there.

rdar://79504652
2021-06-29 16:56:59 -04:00
Konrad `ktoso` Malawski
82e91b7785 [TaskLocals] Enable sync functions to bind task-locals; Keep Storage in TLS 2021-05-11 11:06:16 +09:00
John McCall
78a317ad75 Add support for declaring thread-local variables in the runtime.
Use native thread-locals when available and simulated
thread-locals when not.  The simulation layer uses
pthread_getspecific.

Using TLS is significantly more annoying this way, but I kindof
like it because it reinforces that TLS accesses aren't as cheap
as they look.
2020-12-02 18:47:02 -05:00