Skip to content

Commit c75781a

Browse files
committed
[Threading] Use tss_dtor_t and not just void(*)(void *).
Although the C11 spec says `tss_dtor_t` is `void(*)(void *)`, there may be modifiers on the former typedef, so we should use it instead of directly writing the type. rdar://144220714
1 parent cf8a5bd commit c75781a

File tree

1 file changed

+1
-1
lines changed
  • include/swift/Threading/Impl

1 file changed

+1
-1
lines changed

include/swift/Threading/Impl/C11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ inline void once_impl(once_t &predicate, void (*fn)(void *), void *context) {
221221
#endif
222222

223223
using tls_key_t = ::tss_t;
224-
using tls_dtor_t = void (*)(void *);
224+
using tls_dtor_t = ::tss_dtor_t;
225225

226226
inline bool tls_alloc(tls_key_t &key, tls_dtor_t dtor) {
227227
return ::tss_create(&key, dtor) == thrd_success;

0 commit comments

Comments
 (0)