#include <dispatch/dispatch.h>
#include <mach/mach.h>
#include <pthread.h>
#include <stdint.h>
#include <TargetConditionals.h>
#include <libkern/OSAtomic.h>
struct notify_globals_s
{
pthread_mutex_t notify_lock;
OSSpinLock checkLock;
int32_t notify_ipc_version;
pid_t notify_server_pid;
uint32_t client_opts;
uint32_t saved_opts;
uint64_t name_id;
dispatch_once_t self_state_once;
notify_state_t *self_state;
dispatch_once_t notify_server_port_once;
mach_port_t notify_server_port;
mach_port_t saved_server_port;
mach_port_t notify_common_port;
int notify_common_token;
dispatch_source_t notify_dispatch_source;
dispatch_source_t server_proc_source;
dispatch_once_t internal_once;
table_t *registration_table;
table_t *name_table;
uint32_t token_id;
dispatch_once_t make_background_send_queue_once;
dispatch_queue_t background_send_queue;
uint32_t fd_count;
int *fd_clnt;
int *fd_srv;
int *fd_refcount;
uint32_t mp_count;
mach_port_t *mp_list;
int *mp_refcount;
int *mp_mine;
uint32_t *shm_base;
};
typedef struct notify_globals_s *notify_globals_t;
#if __has_include(<os/alloc_once_private.h>)
#include <os/alloc_once_private.h>
#if defined(OS_ALLOC_ONCE_KEY_LIBSYSTEM_NOTIFY)
#define _NOTIFY_HAS_ALLOC_ONCE 1
#endif
#endif
__attribute__((visibility("hidden")))
void _notify_init_globals(void * globals);
__attribute__((visibility("hidden")))
notify_globals_t _notify_globals_impl(void);
__attribute__((__pure__))
static inline notify_globals_t
_notify_globals(void)
{
#if _NOTIFY_HAS_ALLOC_ONCE
return (notify_globals_t)os_alloc_once(OS_ALLOC_ONCE_KEY_LIBSYSTEM_NOTIFY,
sizeof(struct notify_globals_s), &_notify_init_globals);
#else
return _notify_globals_impl();
#endif
}