mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
runtime: correct _stdlib_thread_key_create
The mapping of the return value of the `FlsAlloc` was flipped resulting in the failure of the TLS key creation. The test suite would fail to generate the TLS key resulting in failures.
This commit is contained in:
@@ -43,7 +43,9 @@ static inline int
|
||||
_stdlib_thread_key_create(__swift_thread_key_t * _Nonnull key,
|
||||
__swift_thread_key_destructor _Nullable destructor) {
|
||||
*key = FlsAlloc(destroyTLS_CCAdjustmentThunk);
|
||||
return *key != FLS_OUT_OF_INDEXES;
|
||||
if (*key == FLS_OUT_OF_INDEXES)
|
||||
return GetLastError();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user