Skip to content

Commit 9feba93

Browse files
committed
Fix the signature of _dispatch_install_thread_detach_callback()
This function is declared as accepting a `dispatch_function_t` callback, which is a function pointer with a `void *` argument. However, the implementation and Swift overlay declare the callback without arguments, causing a conflict which Clang warns about. Change the function signature to accept the correct type.
1 parent 0710b29 commit 9feba93

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

private/queue_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ dispatch_async_enforce_qos_class_f(dispatch_queue_t queue,
342342
* "detached" before the thread exits or the application will crash.
343343
*/
344344
DISPATCH_EXPORT
345-
void _dispatch_install_thread_detach_callback(dispatch_function_t cb);
345+
void _dispatch_install_thread_detach_callback(void (*cb)(void));
346346
#endif
347347

348348
__END_DECLS

src/queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ gettid(void)
953953
static void (*_dispatch_thread_detach_callback)(void);
954954

955955
void
956-
_dispatch_install_thread_detach_callback(dispatch_function_t cb)
956+
_dispatch_install_thread_detach_callback(void (*cb)(void))
957957
{
958958
if (os_atomic_xchg(&_dispatch_thread_detach_callback, cb, relaxed)) {
959959
DISPATCH_CLIENT_CRASH(0, "Installing a thread detach callback twice");

0 commit comments

Comments
 (0)