Skip to content

Commit

Permalink
Fix the signature of _dispatch_install_thread_detach_callback()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
adierking committed Oct 15, 2018
1 parent 0710b29 commit 9feba93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion private/queue_private.h
Expand Up @@ -342,7 +342,7 @@ dispatch_async_enforce_qos_class_f(dispatch_queue_t queue,
* "detached" before the thread exits or the application will crash.
*/
DISPATCH_EXPORT
void _dispatch_install_thread_detach_callback(dispatch_function_t cb);
void _dispatch_install_thread_detach_callback(void (*cb)(void));
#endif

__END_DECLS
Expand Down
2 changes: 1 addition & 1 deletion src/queue.c
Expand Up @@ -953,7 +953,7 @@ gettid(void)
static void (*_dispatch_thread_detach_callback)(void);

void
_dispatch_install_thread_detach_callback(dispatch_function_t cb)
_dispatch_install_thread_detach_callback(void (*cb)(void))
{
if (os_atomic_xchg(&_dispatch_thread_detach_callback, cb, relaxed)) {
DISPATCH_CLIENT_CRASH(0, "Installing a thread detach callback twice");
Expand Down

0 comments on commit 9feba93

Please sign in to comment.