Skip to content

std.c.darwin.dispatch

Standard libraryZig 0.17.1Official documentation
Sourcestd/c/darwin/dispatch.zig

Source line 2

std.c.darwin.dispatch._dispatch_main_q

variable

Source line 122

queue_s

std.c.darwin.dispatch._dispatch_queue_attr_concurrent

variable

Source line 133

queue_attr_s

std.c.darwin.dispatch._dispatch_source_type_data_add

constant

Source line 263

source_type_s

std.c.darwin.dispatch._dispatch_source_type_data_or

constant

Source line 264

source_type_s

std.c.darwin.dispatch._dispatch_source_type_data_replace

constant

Source line 265

source_type_s

std.c.darwin.dispatch._dispatch_source_type_mach_recv

constant

Source line 267

source_type_s

std.c.darwin.dispatch._dispatch_source_type_mach_send

constant

Source line 266

source_type_s

std.c.darwin.dispatch._dispatch_source_type_memorypressure

constant

Source line 268

source_type_s

std.c.darwin.dispatch._dispatch_source_type_proc

constant

Source line 269

source_type_s

std.c.darwin.dispatch._dispatch_source_type_read

constant

Source line 270

source_type_s

std.c.darwin.dispatch._dispatch_source_type_signal

constant

Source line 271

source_type_s

std.c.darwin.dispatch._dispatch_source_type_timer

constant

Source line 272

source_type_s

std.c.darwin.dispatch._dispatch_source_type_vnode

constant

Source line 273

source_type_s

std.c.darwin.dispatch._dispatch_source_type_write

constant

Source line 274

source_type_s

std.c.darwin.dispatch._os_object_s

container

Source line 15

std.c.darwin.dispatch._os_object_s.@"resume"

alias

Source line 23

Alias of std.c.darwin.dispatch.dispatch_resume

std.c.darwin.dispatch._os_object_s.@"suspend"

alias

Source line 22

Alias of std.c.darwin.dispatch.dispatch_suspend

std.c.darwin.dispatch._os_object_s.activate

alias

Source line 21

Alias of std.c.darwin.dispatch.dispatch_activate

std.c.darwin.dispatch._os_object_s.get_context

alias

Source line 18

Alias of std.c.darwin.dispatch.dispatch_get_context

std.c.darwin.dispatch._os_object_s.release

alias

Source line 17

Alias of std.c.darwin.dispatch.dispatch_release

std.c.darwin.dispatch._os_object_s.retain

alias

Source line 16

Alias of std.c.darwin.dispatch.dispatch_retain

std.c.darwin.dispatch._os_object_s.set_context

alias

Source line 19

Alias of std.c.darwin.dispatch.dispatch_set_context

std.c.darwin.dispatch._os_object_s.set_finalizer

alias

Source line 20

Alias of std.c.darwin.dispatch.dispatch_set_finalizer_f

std.c.darwin.dispatch._os_object_s.set_target_queue

alias

Source line 24

Alias of std.c.darwin.dispatch.dispatch_set_target_queue

std.c.darwin.dispatch.@"resume"

alias

Source line 13

Alias of std.c.darwin.dispatch.dispatch_resume

std.c.darwin.dispatch.@"suspend"

alias

Source line 12

Alias of std.c.darwin.dispatch.dispatch_suspend

std.c.darwin.dispatch.activate

alias

Source line 11

Alias of std.c.darwin.dispatch.dispatch_activate

std.c.darwin.dispatch.after_f

alias

Source line 99

Alias of std.c.darwin.dispatch.dispatch_after_f

std.c.darwin.dispatch.apply_f

alias

Source line 66

Alias of std.c.darwin.dispatch.dispatch_apply_f

std.c.darwin.dispatch.async_and_wait_f

alias

Source line 65

Alias of std.c.darwin.dispatch.dispatch_async_and_wait_f

std.c.darwin.dispatch.async_f

alias

Source line 63

Alias of std.c.darwin.dispatch.dispatch_async_f

std.c.darwin.dispatch.builtin

constant

Source line 307

std.c.darwin.dispatch.CURRENT_QUEUE_LABEL

primitive

Source line 96

?[*:0]const u8

std.c.darwin.dispatch.dispatch_activate

function

Source line 31

extern "c" fn dispatch_activate(object: object_t) void

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_after_f

function

Source line 140

extern "c" fn dispatch_after_f(when: time_t, queue: queue_t, context: ?*anyopaque, work: function_t) void

Parameters

when: time_t
queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_apply_f

function

Source line 120

extern "c" fn dispatch_apply_f(iterations: usize, queue: ?queue_t, context: ?*anyopaque, work: *const fn (context: ?*anyopaque, iteration: usize) callconv(.c) void) void

Parameters

iterations: usize
queue: ?queue_t
context: ?*anyopaque
work: *const fn (context: ?*anyopaque, iteration: usize) callconv(.c) void

std.c.darwin.dispatch.dispatch_async_and_wait_f

function

Source line 119

extern "c" fn dispatch_async_and_wait_f(queue: queue_t, context: ?*anyopaque, work: function_t) void

Parameters

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_async_f

function

Source line 117

extern "c" fn dispatch_async_f(queue: queue_t, context: ?*anyopaque, work: function_t) void

Parameters

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_get_context

function

Source line 28

extern "c" fn dispatch_get_context(object: object_t) ?*anyopaque

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_get_current_queue

function

Source line 121

extern "c" fn dispatch_get_current_queue() queue_t

std.c.darwin.dispatch.dispatch_get_global_queue

function

Source line 123

extern "c" fn dispatch_get_global_queue(identifier: isize, flags: usize) queue_global_t

Parameters

identifier: isize
flags: usize

std.c.darwin.dispatch.dispatch_main

function

Source line 139

extern "c" fn dispatch_main() noreturn

std.c.darwin.dispatch.dispatch_once_f

function

Source line 54

extern "c" fn dispatch_once_f(predicate: *once_t, context: ?*anyopaque, function: function_t) void

Parameters

predicate: *once_t
context: ?*anyopaque
function: function_t

std.c.darwin.dispatch.dispatch_queue_attr_make_initially_inactive

function

Source line 134

extern "c" fn dispatch_queue_attr_make_initially_inactive(attr: queue_attr_t) queue_attr_t

Parameters

attr: queue_attr_t

std.c.darwin.dispatch.dispatch_queue_create

function

Source line 136

extern "c" fn dispatch_queue_create(label: ?[*:0]const u8, attr: queue_attr_t) ?queue_t

Parameters

label: ?[*:0]const u8
attr: queue_attr_t

std.c.darwin.dispatch.dispatch_queue_create_with_target

function

Source line 135

extern "c" fn dispatch_queue_create_with_target(label: ?[*:0]const u8, attr: queue_attr_t, target: ?queue_t) ?queue_t

Parameters

label: ?[*:0]const u8
attr: queue_attr_t
target: ?queue_t

std.c.darwin.dispatch.dispatch_queue_get_label

function

Source line 137

extern "c" fn dispatch_queue_get_label(queue: ?queue_t) [*:0]const u8

Parameters

queue: ?queue_t

std.c.darwin.dispatch.dispatch_release

function

Source line 27

extern "c" fn dispatch_release(object: object_t) void

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_resume

function

Source line 33

extern "c" fn dispatch_resume(object: object_t) void

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_retain

function

Source line 26

extern "c" fn dispatch_retain(object: object_t) void

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_semaphore_create

function

Source line 156

extern "c" fn dispatch_semaphore_create(value: isize) ?semaphore_t

Parameters

value: isize

std.c.darwin.dispatch.dispatch_semaphore_signal

function

Source line 158

extern "c" fn dispatch_semaphore_signal(dsema: semaphore_t) isize

Parameters

dsema: semaphore_t

std.c.darwin.dispatch.dispatch_semaphore_wait

function

Source line 157

extern "c" fn dispatch_semaphore_wait(dsema: semaphore_t, timeout: time_t) isize

Parameters

dsema: semaphore_t
timeout: time_t

std.c.darwin.dispatch.dispatch_set_context

function

Source line 29

extern "c" fn dispatch_set_context(object: object_t, context: ?*anyopaque) void

Parameters

object: object_t
context: ?*anyopaque

std.c.darwin.dispatch.dispatch_set_finalizer_f

function

Source line 30

extern "c" fn dispatch_set_finalizer_f(object: object_t, finalizer: ?function_t) void

Parameters

object: object_t
finalizer: ?function_t

std.c.darwin.dispatch.dispatch_set_target_queue

function

Source line 138

extern "c" fn dispatch_set_target_queue(object: object_t, queue: ?queue_t) void

Parameters

object: object_t
queue: ?queue_t

std.c.darwin.dispatch.dispatch_source_cancel

function

Source line 278

extern "c" fn dispatch_source_cancel(source: source_t) void

Parameters

source: source_t

std.c.darwin.dispatch.dispatch_source_create

function

Source line 275

extern "c" fn dispatch_source_create(type: source_type_t, handle: usize, mask: source_flags_t, queue: ?queue_t) ?source_t

Parameters

type: source_type_t
handle: usize
mask: source_flags_t
queue: ?queue_t

std.c.darwin.dispatch.dispatch_source_get_data

function

Source line 282

extern "c" fn dispatch_source_get_data(source: source_t) usize

Parameters

source: source_t

std.c.darwin.dispatch.dispatch_source_get_handle

function

Source line 280

extern "c" fn dispatch_source_get_handle(source: source_t) usize

Parameters

source: source_t

std.c.darwin.dispatch.dispatch_source_get_mask

function

Source line 281

extern "c" fn dispatch_source_get_mask(source: source_t) source_flags_t

Parameters

source: source_t

std.c.darwin.dispatch.dispatch_source_merge_data

function

Source line 283

extern "c" fn dispatch_source_merge_data(source: source_t, value: usize) void

Parameters

source: source_t
value: usize

std.c.darwin.dispatch.dispatch_source_set_cancel_handler_f

function

Source line 277

extern "c" fn dispatch_source_set_cancel_handler_f(source: source_t, handler: ?function_t) void

Parameters

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_event_handler_f

function

Source line 276

extern "c" fn dispatch_source_set_event_handler_f(source: source_t, handler: ?function_t) void

Parameters

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_registration_handler_f

function

Source line 285

extern "c" fn dispatch_source_set_registration_handler_f(source: source_t, handler: ?function_t) void

Parameters

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_timer

function

Source line 284

extern "c" fn dispatch_source_set_timer(source: source_t, start: time_t, interval: u64, leeway: u64) void

Parameters

source: source_t
start: time_t
interval: u64
leeway: u64

std.c.darwin.dispatch.dispatch_source_testcancel

function

Source line 279

extern "c" fn dispatch_source_testcancel(source: source_t) isize

Parameters

source: source_t

std.c.darwin.dispatch.dispatch_suspend

function

Source line 32

extern "c" fn dispatch_suspend(object: object_t) void

Parameters

object: object_t

std.c.darwin.dispatch.dispatch_sync_f

function

Source line 118

extern "c" fn dispatch_sync_f(queue: queue_t, context: ?*anyopaque, work: function_t) void

Parameters

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_time

function

Source line 304

extern "c" fn dispatch_time(when: time_t, delta: i64) time_t

Parameters

when: time_t
delta: i64

std.c.darwin.dispatch.dispatch_walltime

function

Source line 305

extern "c" fn dispatch_walltime(when: ?*const std.c.timespec, delta: i64) time_t

Parameters

when: ?*const std.c.timespec
delta: i64

std.c.darwin.dispatch.function_t

type

Source line 2

std.c.darwin.dispatch.get_context

alias

Source line 8

Alias of std.c.darwin.dispatch.dispatch_get_context

std.c.darwin.dispatch.get_current_queue

alias

Source line 67

Alias of std.c.darwin.dispatch.dispatch_get_current_queue

std.c.darwin.dispatch.get_global_queue

alias

Source line 78

Alias of std.c.darwin.dispatch.dispatch_get_global_queue

std.c.darwin.dispatch.get_main_queue

function

Source line 68

pub inline fn get_main_queue() queue_main_t

std.c.darwin.dispatch.main

alias

Source line 98

Alias of std.c.darwin.dispatch.dispatch_main

std.c.darwin.dispatch.object_t

type

Source line 5

std.c.darwin.dispatch.once_f

alias

Source line 52

Alias of std.c.darwin.dispatch.dispatch_once_f

std.c.darwin.dispatch.once_t

container

Source line 36

Fields

init = 0
done = -1
_

std.c.darwin.dispatch.once_t.once

function

Source line 41

pub inline fn once(predicate: *once_t, context: ?*anyopaque, function: function_t) void

Parameters

predicate: *once_t
context: ?*anyopaque
function: function_t

std.c.darwin.dispatch.queue_attr_make_initially_inactive

alias

Source line 92

Alias of std.c.darwin.dispatch.dispatch_queue_attr_make_initially_inactive

std.c.darwin.dispatch.queue_attr_s

container

Source line 124

std.c.darwin.dispatch.queue_attr_s.as_object

function

Source line 125

pub inline fn as_object(queue_attr: queue_attr_t) object_t

Parameters

queue_attr: queue_attr_t

std.c.darwin.dispatch.queue_attr_s.CONCURRENT

alias

Source line 130

Alias of std.c.darwin.dispatch.QUEUE_CONCURRENT

std.c.darwin.dispatch.queue_attr_s.CONCURRENT_INACTIVE

alias

Source line 131

Alias of std.c.darwin.dispatch.QUEUE_CONCURRENT_INACTIVE

std.c.darwin.dispatch.queue_attr_s.INACTIVE

alias

Source line 129

Alias of std.c.darwin.dispatch.QUEUE_INACTIVE

std.c.darwin.dispatch.queue_attr_s.SERIAL

alias

Source line 128

Alias of std.c.darwin.dispatch.QUEUE_SERIAL

std.c.darwin.dispatch.queue_attr_t

type

Source line 79

std.c.darwin.dispatch.QUEUE_CONCURRENT

function

Source line 86

pub inline fn QUEUE_CONCURRENT() queue_attr_t

std.c.darwin.dispatch.QUEUE_CONCURRENT_INACTIVE

function

Source line 89

pub inline fn QUEUE_CONCURRENT_INACTIVE() queue_attr_t

std.c.darwin.dispatch.queue_concurrent_t

alias

Source line 62

Alias of std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_create

alias

Source line 95

Alias of std.c.darwin.dispatch.dispatch_queue_create

std.c.darwin.dispatch.queue_create_with_target

alias

Source line 94

Alias of std.c.darwin.dispatch.dispatch_queue_create_with_target

std.c.darwin.dispatch.queue_get_label

alias

Source line 97

Alias of std.c.darwin.dispatch.dispatch_queue_get_label

std.c.darwin.dispatch.queue_global_t

alias

Source line 58

Alias of std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.QUEUE_INACTIVE

function

Source line 83

pub inline fn QUEUE_INACTIVE() queue_attr_t

std.c.darwin.dispatch.queue_main_t

alias

Source line 61

Alias of std.c.darwin.dispatch.queue_serial_t

std.c.darwin.dispatch.queue_priority_t

container

Source line 71

Fields

HIGH = 2
DEFAULT = 0
LOW = -1
BACKGROUND = std.math.minInt(i16)
_

std.c.darwin.dispatch.queue_s

container

Source line 101

std.c.darwin.dispatch.queue_s.apply

alias

Source line 108

Alias of std.c.darwin.dispatch.apply_f

std.c.darwin.dispatch.queue_s.as_object

function

Source line 102

pub inline fn as_object(queue: queue_t) object_t

Parameters

queue: queue_t

std.c.darwin.dispatch.queue_s.async

alias

Source line 105

Alias of std.c.darwin.dispatch.async_f

std.c.darwin.dispatch.queue_s.async_and_wait

alias

Source line 107

Alias of std.c.darwin.dispatch.async_and_wait_f

std.c.darwin.dispatch.queue_s.create

alias

Source line 114

Alias of std.c.darwin.dispatch.queue_create

std.c.darwin.dispatch.queue_s.create_with_target

alias

Source line 113

Alias of std.c.darwin.dispatch.queue_create_with_target

std.c.darwin.dispatch.queue_s.get_current

alias

Source line 109

Alias of std.c.darwin.dispatch.get_current_queue

std.c.darwin.dispatch.queue_s.get_global

alias

Source line 111

Alias of std.c.darwin.dispatch.get_global_queue

std.c.darwin.dispatch.queue_s.get_label

alias

Source line 115

Alias of std.c.darwin.dispatch.queue_get_label

std.c.darwin.dispatch.queue_s.get_main

alias

Source line 110

Alias of std.c.darwin.dispatch.get_main_queue

std.c.darwin.dispatch.queue_s.sync

alias

Source line 106

Alias of std.c.darwin.dispatch.sync_f

std.c.darwin.dispatch.queue_s.TARGET_DEFAULT

alias

Source line 112

Alias of std.c.darwin.dispatch.TARGET_QUEUE_DEFAULT

std.c.darwin.dispatch.QUEUE_SERIAL

function

Source line 80

pub inline fn QUEUE_SERIAL() queue_attr_t

std.c.darwin.dispatch.queue_serial_executor_t

alias

Source line 59

Alias of std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_serial_t

alias

Source line 60

Alias of std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_t

type

Source line 57

std.c.darwin.dispatch.release

alias

Source line 7

Alias of std.c.darwin.dispatch.dispatch_release

std.c.darwin.dispatch.retain

alias

Source line 6

Alias of std.c.darwin.dispatch.dispatch_retain

std.c.darwin.dispatch.semaphore_create

alias

Source line 144

Alias of std.c.darwin.dispatch.dispatch_semaphore_create

std.c.darwin.dispatch.semaphore_s

container

Source line 148

std.c.darwin.dispatch.semaphore_s.as_object

function

Source line 149

pub inline fn as_object(semaphore: semaphore_t) object_t

Parameters

semaphore: semaphore_t

std.c.darwin.dispatch.semaphore_s.create

alias

Source line 152

Alias of std.c.darwin.dispatch.semaphore_create

std.c.darwin.dispatch.semaphore_s.signal

alias

Source line 154

Alias of std.c.darwin.dispatch.semaphore_signal

std.c.darwin.dispatch.semaphore_s.wait

alias

Source line 153

Alias of std.c.darwin.dispatch.semaphore_wait

std.c.darwin.dispatch.semaphore_signal

alias

Source line 146

Alias of std.c.darwin.dispatch.dispatch_semaphore_signal

std.c.darwin.dispatch.semaphore_t

type

Source line 143

std.c.darwin.dispatch.semaphore_wait

alias

Source line 145

Alias of std.c.darwin.dispatch.dispatch_semaphore_wait

std.c.darwin.dispatch.set_context

alias

Source line 9

Alias of std.c.darwin.dispatch.dispatch_set_context

std.c.darwin.dispatch.set_finalizer_f

alias

Source line 10

Alias of std.c.darwin.dispatch.dispatch_set_finalizer_f

std.c.darwin.dispatch.source_cancel

alias

Source line 225

Alias of std.c.darwin.dispatch.dispatch_source_cancel

std.c.darwin.dispatch.source_create

alias

Source line 222

Alias of std.c.darwin.dispatch.dispatch_source_create

std.c.darwin.dispatch.source_flags_t

container

Source line 213

Fields

std.c.darwin.dispatch.source_flags_t.none

constant

Source line 220

source_flags_t

std.c.darwin.dispatch.source_get_data

alias

Source line 229

Alias of std.c.darwin.dispatch.dispatch_source_get_data

std.c.darwin.dispatch.source_get_handle

alias

Source line 227

Alias of std.c.darwin.dispatch.dispatch_source_get_handle

std.c.darwin.dispatch.source_get_mask

alias

Source line 228

Alias of std.c.darwin.dispatch.dispatch_source_get_mask

std.c.darwin.dispatch.source_mach_recv_flags_t

container

Source line 179

Fields

unused0: @Int(.unsigned, @bitSizeOf(usize) - 0) = 0

std.c.darwin.dispatch.source_mach_send_flags_t

container

Source line 175

Fields

DEAD: bool = false
unused1: @Int(.unsigned, @bitSizeOf(usize) - 1) = 0

std.c.darwin.dispatch.source_memorypressure_flags_t

container

Source line 182

Fields

NORMAL: bool = false
WARN: bool = false
CRITICAL: bool = false
unused3: @Int(.unsigned, @bitSizeOf(usize) - 3) = 0

std.c.darwin.dispatch.source_merge_data

alias

Source line 230

Alias of std.c.darwin.dispatch.dispatch_source_merge_data

std.c.darwin.dispatch.source_proc_flags_t

container

Source line 188

Fields

unused0: u27 = 0
SIGNAL: bool = false
unused28: u1 = 0
EXEC: bool = false
FORK: bool = false
EXIT: bool = false
unused32: @Int(.unsigned, @bitSizeOf(usize) - 32) = 0

std.c.darwin.dispatch.source_s

container

Source line 234

std.c.darwin.dispatch.source_s.as_object

function

Source line 235

pub inline fn as_object(source: source_t) object_t

Parameters

source: source_t

std.c.darwin.dispatch.source_s.cancel

alias

Source line 240

Alias of std.c.darwin.dispatch.source_cancel

std.c.darwin.dispatch.source_s.get_data

alias

Source line 244

Alias of std.c.darwin.dispatch.source_get_data

std.c.darwin.dispatch.source_s.get_handle

alias

Source line 242

Alias of std.c.darwin.dispatch.source_get_handle

std.c.darwin.dispatch.source_s.get_mask

alias

Source line 243

Alias of std.c.darwin.dispatch.source_get_mask

std.c.darwin.dispatch.source_s.merge_data

alias

Source line 245

Alias of std.c.darwin.dispatch.source_merge_data

std.c.darwin.dispatch.source_s.set_cancel_handler

alias

Source line 239

Alias of std.c.darwin.dispatch.source_set_cancel_handler_f

std.c.darwin.dispatch.source_s.set_event_handler

alias

Source line 238

Alias of std.c.darwin.dispatch.source_set_event_handler_f

std.c.darwin.dispatch.source_s.set_registration_handler

alias

Source line 247

Alias of std.c.darwin.dispatch.source_set_registration_handler_f

std.c.darwin.dispatch.source_s.set_timer

alias

Source line 246

Alias of std.c.darwin.dispatch.source_set_timer

std.c.darwin.dispatch.source_s.testcancel

alias

Source line 241

Alias of std.c.darwin.dispatch.source_testcancel

std.c.darwin.dispatch.source_set_cancel_handler_f

alias

Source line 224

Alias of std.c.darwin.dispatch.dispatch_source_set_cancel_handler_f

std.c.darwin.dispatch.source_set_event_handler_f

alias

Source line 223

Alias of std.c.darwin.dispatch.dispatch_source_set_event_handler_f

std.c.darwin.dispatch.source_set_registration_handler_f

alias

Source line 232

Alias of std.c.darwin.dispatch.dispatch_source_set_registration_handler_f

std.c.darwin.dispatch.source_set_timer

alias

Source line 231

Alias of std.c.darwin.dispatch.dispatch_source_set_timer

std.c.darwin.dispatch.source_t

type

Source line 161

std.c.darwin.dispatch.source_testcancel

alias

Source line 226

Alias of std.c.darwin.dispatch.dispatch_source_testcancel

std.c.darwin.dispatch.source_timer_flags_t

container

Source line 209

Fields

STRICT: bool = false
unused1: @Int(.unsigned, @bitSizeOf(usize) - 1) = 0

std.c.darwin.dispatch.SOURCE_TYPE_DATA_ADD

constant

Source line 163

std.c.darwin.dispatch.SOURCE_TYPE_DATA_OR

constant

Source line 164

std.c.darwin.dispatch.SOURCE_TYPE_DATA_REPLACE

constant

Source line 165

std.c.darwin.dispatch.SOURCE_TYPE_MACH_RECV

constant

Source line 167

std.c.darwin.dispatch.SOURCE_TYPE_MACH_SEND

constant

Source line 166

std.c.darwin.dispatch.SOURCE_TYPE_MEMORYPRESSURE

constant

Source line 168

std.c.darwin.dispatch.SOURCE_TYPE_PROC

constant

Source line 169

std.c.darwin.dispatch.SOURCE_TYPE_READ

constant

Source line 170

std.c.darwin.dispatch.source_type_s

container

Source line 249

std.c.darwin.dispatch.source_type_s.DATA_ADD

alias

Source line 250

Alias of std.c.darwin.dispatch.SOURCE_TYPE_DATA_ADD

std.c.darwin.dispatch.source_type_s.DATA_OR

alias

Source line 251

Alias of std.c.darwin.dispatch.SOURCE_TYPE_DATA_OR

std.c.darwin.dispatch.source_type_s.DATA_REPLACE

alias

Source line 252

Alias of std.c.darwin.dispatch.SOURCE_TYPE_DATA_REPLACE

std.c.darwin.dispatch.source_type_s.MACH_RECV

alias

Source line 254

Alias of std.c.darwin.dispatch.SOURCE_TYPE_MACH_RECV

std.c.darwin.dispatch.source_type_s.MACH_SEND

alias

Source line 253

Alias of std.c.darwin.dispatch.SOURCE_TYPE_MACH_SEND

std.c.darwin.dispatch.source_type_s.MEMORYPRESSURE

alias

Source line 255

Alias of std.c.darwin.dispatch.SOURCE_TYPE_MEMORYPRESSURE

std.c.darwin.dispatch.source_type_s.PROC

alias

Source line 256

Alias of std.c.darwin.dispatch.SOURCE_TYPE_PROC

std.c.darwin.dispatch.source_type_s.READ

alias

Source line 257

Alias of std.c.darwin.dispatch.SOURCE_TYPE_READ

std.c.darwin.dispatch.source_type_s.SIGNAL

alias

Source line 258

Alias of std.c.darwin.dispatch.SOURCE_TYPE_SIGNAL

std.c.darwin.dispatch.source_type_s.TIMER

alias

Source line 259

Alias of std.c.darwin.dispatch.SOURCE_TYPE_TIMER

std.c.darwin.dispatch.source_type_s.VNODE

alias

Source line 260

Alias of std.c.darwin.dispatch.SOURCE_TYPE_VNODE

std.c.darwin.dispatch.source_type_s.WRITE

alias

Source line 261

Alias of std.c.darwin.dispatch.SOURCE_TYPE_WRITE

std.c.darwin.dispatch.SOURCE_TYPE_SIGNAL

constant

Source line 171

std.c.darwin.dispatch.source_type_t

type

Source line 162

std.c.darwin.dispatch.SOURCE_TYPE_TIMER

constant

Source line 172

std.c.darwin.dispatch.SOURCE_TYPE_VNODE

constant

Source line 173

std.c.darwin.dispatch.SOURCE_TYPE_WRITE

constant

Source line 174

std.c.darwin.dispatch.source_vnode_flags_t

container

Source line 197

Fields

DELETE: bool = false
WRITE: bool = false
EXTEND: bool = false
ATTRIB: bool = false
LINK: bool = false
RENAME: bool = false
REVOKE: bool = false
unused7: u1 = 0
FUNLOCK: bool = false
unused9: @Int(.unsigned, @bitSizeOf(usize) - 9) = 0

std.c.darwin.dispatch.std

alias

Source line 308

Alias of std

std.c.darwin.dispatch.sync_f

alias

Source line 64

Alias of std.c.darwin.dispatch.dispatch_sync_f

std.c.darwin.dispatch.TARGET_QUEUE_DEFAULT

primitive

Source line 93

?queue_t

std.c.darwin.dispatch.time

alias

Source line 301

Alias of std.c.darwin.dispatch.dispatch_time

std.c.darwin.dispatch.TIME_FOREVER

constant

Source line 300

std.c.darwin.dispatch.TIME_NOW

constant

Source line 299

u64

std.c.darwin.dispatch.time_t

container

Source line 288

Fields

WALL_NOW = WALLTIME_NOW
NOW = TIME_NOW
FOREVER = TIME_FOREVER
_

std.c.darwin.dispatch.time_t.after

alias

Source line 296

Alias of std.c.darwin.dispatch.dispatch_after_f

std.c.darwin.dispatch.time_t.time

alias

Source line 294

Alias of std.c.darwin.dispatch.dispatch_time

std.c.darwin.dispatch.time_t.walltime

alias

Source line 295

Alias of std.c.darwin.dispatch.dispatch_walltime

std.c.darwin.dispatch.walltime

alias

Source line 302

Alias of std.c.darwin.dispatch.dispatch_walltime

std.c.darwin.dispatch.WALLTIME_NOW

constant

Source line 298

Source code

std/c/darwin/dispatch.zig

// dispatch/base.h
pub const function_t = *const fn (?*anyopaque) callconv(.c) void;

// dispatch/object.h
pub const object_t = *_os_object_s;
pub const retain = dispatch_retain;
pub const release = dispatch_release;
pub const get_context = dispatch_get_context;
pub const set_context = dispatch_set_context;
pub const set_finalizer_f = dispatch_set_finalizer_f;
pub const activate = dispatch_activate;
pub const @"suspend" = dispatch_suspend;
pub const @"resume" = dispatch_resume;

const _os_object_s = opaque {
    pub const retain = dispatch_retain;
    pub const release = dispatch_release;
    pub const get_context = dispatch_get_context;
    pub const set_context = dispatch_set_context;
    pub const set_finalizer = dispatch_set_finalizer_f;
    pub const activate = dispatch_activate;
    pub const @"suspend" = dispatch_suspend;
    pub const @"resume" = dispatch_resume;
    pub const set_target_queue = dispatch_set_target_queue;
};
extern "c" fn dispatch_retain(object: object_t) void;
extern "c" fn dispatch_release(object: object_t) void;
extern "c" fn dispatch_get_context(object: object_t) ?*anyopaque;
extern "c" fn dispatch_set_context(object: object_t, context: ?*anyopaque) void;
extern "c" fn dispatch_set_finalizer_f(object: object_t, finalizer: ?function_t) void;
extern "c" fn dispatch_activate(object: object_t) void;
extern "c" fn dispatch_suspend(object: object_t) void;
extern "c" fn dispatch_resume(object: object_t) void;

// dispatch/once.h
pub const once_t = enum(isize) {
    init = 0,
    done = -1,
    _,

    pub inline fn once(predicate: *once_t, context: ?*anyopaque, function: function_t) void {
        if (predicate.* != .done) {
            @branchHint(.unlikely);
            once_f(predicate, context, function);
        } else asm volatile ("" ::: .{ .memory = true });
        switch (builtin.mode) {
            .debug, .safe => {},
            .fast, .small => if (predicate.* != .done) unreachable,
        }
    }
};
pub const once_f = dispatch_once_f;

extern "c" fn dispatch_once_f(predicate: *once_t, context: ?*anyopaque, function: function_t) void;

// dispatch/queue.h
pub const queue_t = *queue_s;
pub const queue_global_t = queue_t;
pub const queue_serial_executor_t = queue_t;
pub const queue_serial_t = queue_t;
pub const queue_main_t = queue_serial_t;
pub const queue_concurrent_t = queue_t;
pub const async_f = dispatch_async_f;
pub const sync_f = dispatch_sync_f;
pub const async_and_wait_f = dispatch_async_and_wait_f;
pub const apply_f = dispatch_apply_f;
pub const get_current_queue = dispatch_get_current_queue;
pub inline fn get_main_queue() queue_main_t {
    return &_dispatch_main_q;
}
pub const queue_priority_t = enum(c_long) {
    HIGH = 2,
    DEFAULT = 0,
    LOW = -1,
    BACKGROUND = std.math.minInt(i16),
    _,
};
pub const get_global_queue = dispatch_get_global_queue;
pub const queue_attr_t = ?*queue_attr_s;
pub inline fn QUEUE_SERIAL() queue_attr_t {
    return null;
}
pub inline fn QUEUE_INACTIVE() queue_attr_t {
    return queue_attr_make_initially_inactive(QUEUE_SERIAL());
}
pub inline fn QUEUE_CONCURRENT() queue_attr_t {
    return &_dispatch_queue_attr_concurrent;
}
pub inline fn QUEUE_CONCURRENT_INACTIVE() queue_attr_t {
    return queue_attr_make_initially_inactive(QUEUE_CONCURRENT());
}
pub const queue_attr_make_initially_inactive = dispatch_queue_attr_make_initially_inactive;
pub const TARGET_QUEUE_DEFAULT: ?queue_t = null;
pub const queue_create_with_target = dispatch_queue_create_with_target;
pub const queue_create = dispatch_queue_create;
pub const CURRENT_QUEUE_LABEL: ?[*:0]const u8 = null;
pub const queue_get_label = dispatch_queue_get_label;
pub const main = dispatch_main;
pub const after_f = dispatch_after_f;

const queue_s = opaque {
    pub inline fn as_object(queue: queue_t) object_t {
        return @ptrCast(queue);
    }
    pub const async = async_f;
    pub const sync = sync_f;
    pub const async_and_wait = async_and_wait_f;
    pub const apply = apply_f;
    pub const get_current = get_current_queue;
    pub const get_main = get_main_queue;
    pub const get_global = get_global_queue;
    pub const TARGET_DEFAULT = TARGET_QUEUE_DEFAULT;
    pub const create_with_target = queue_create_with_target;
    pub const create = queue_create;
    pub const get_label = queue_get_label;
};
extern "c" fn dispatch_async_f(queue: queue_t, context: ?*anyopaque, work: function_t) void;
extern "c" fn dispatch_sync_f(queue: queue_t, context: ?*anyopaque, work: function_t) void;
extern "c" fn dispatch_async_and_wait_f(queue: queue_t, context: ?*anyopaque, work: function_t) void;
extern "c" fn dispatch_apply_f(iterations: usize, queue: ?queue_t, context: ?*anyopaque, work: *const fn (context: ?*anyopaque, iteration: usize) callconv(.c) void) void;
extern "c" fn dispatch_get_current_queue() queue_t;
extern "c" var _dispatch_main_q: queue_s;
extern "c" fn dispatch_get_global_queue(identifier: isize, flags: usize) queue_global_t;
const queue_attr_s = opaque {
    pub inline fn as_object(queue_attr: queue_attr_t) object_t {
        return @ptrCast(queue_attr);
    }
    pub const SERIAL = QUEUE_SERIAL;
    pub const INACTIVE = QUEUE_INACTIVE;
    pub const CONCURRENT = QUEUE_CONCURRENT;
    pub const CONCURRENT_INACTIVE = QUEUE_CONCURRENT_INACTIVE;
};
extern "c" var _dispatch_queue_attr_concurrent: queue_attr_s;
extern "c" fn dispatch_queue_attr_make_initially_inactive(attr: queue_attr_t) queue_attr_t;
extern "c" fn dispatch_queue_create_with_target(label: ?[*:0]const u8, attr: queue_attr_t, target: ?queue_t) ?queue_t;
extern "c" fn dispatch_queue_create(label: ?[*:0]const u8, attr: queue_attr_t) ?queue_t;
extern "c" fn dispatch_queue_get_label(queue: ?queue_t) [*:0]const u8;
extern "c" fn dispatch_set_target_queue(object: object_t, queue: ?queue_t) void;
extern "c" fn dispatch_main() noreturn;
extern "c" fn dispatch_after_f(when: time_t, queue: queue_t, context: ?*anyopaque, work: function_t) void;

// dispatch/semaphore.h
pub const semaphore_t = *semaphore_s;
pub const semaphore_create = dispatch_semaphore_create;
pub const semaphore_wait = dispatch_semaphore_wait;
pub const semaphore_signal = dispatch_semaphore_signal;

const semaphore_s = opaque {
    pub inline fn as_object(semaphore: semaphore_t) object_t {
        return @ptrCast(semaphore);
    }
    pub const create = semaphore_create;
    pub const wait = semaphore_wait;
    pub const signal = semaphore_signal;
};
extern "c" fn dispatch_semaphore_create(value: isize) ?semaphore_t;
extern "c" fn dispatch_semaphore_wait(dsema: semaphore_t, timeout: time_t) isize;
extern "c" fn dispatch_semaphore_signal(dsema: semaphore_t) isize;

// dispatch/source.h
pub const source_t = *source_s;
pub const source_type_t = *const source_type_s;
pub const SOURCE_TYPE_DATA_ADD = &_dispatch_source_type_data_add;
pub const SOURCE_TYPE_DATA_OR = &_dispatch_source_type_data_or;
pub const SOURCE_TYPE_DATA_REPLACE = &_dispatch_source_type_data_replace;
pub const SOURCE_TYPE_MACH_SEND = &_dispatch_source_type_mach_send;
pub const SOURCE_TYPE_MACH_RECV = &_dispatch_source_type_mach_recv;
pub const SOURCE_TYPE_MEMORYPRESSURE = &_dispatch_source_type_memorypressure;
pub const SOURCE_TYPE_PROC = &_dispatch_source_type_proc;
pub const SOURCE_TYPE_READ = &_dispatch_source_type_read;
pub const SOURCE_TYPE_SIGNAL = &_dispatch_source_type_signal;
pub const SOURCE_TYPE_TIMER = &_dispatch_source_type_timer;
pub const SOURCE_TYPE_VNODE = &_dispatch_source_type_vnode;
pub const SOURCE_TYPE_WRITE = &_dispatch_source_type_write;
pub const source_mach_send_flags_t = packed struct(usize) {
    DEAD: bool = false,
    unused1: @Int(.unsigned, @bitSizeOf(usize) - 1) = 0,
};
pub const source_mach_recv_flags_t = packed struct(usize) {
    unused0: @Int(.unsigned, @bitSizeOf(usize) - 0) = 0,
};
pub const source_memorypressure_flags_t = packed struct(usize) {
    NORMAL: bool = false,
    WARN: bool = false,
    CRITICAL: bool = false,
    unused3: @Int(.unsigned, @bitSizeOf(usize) - 3) = 0,
};
pub const source_proc_flags_t = packed struct(usize) {
    unused0: u27 = 0,
    SIGNAL: bool = false,
    unused28: u1 = 0,
    EXEC: bool = false,
    FORK: bool = false,
    EXIT: bool = false,
    unused32: @Int(.unsigned, @bitSizeOf(usize) - 32) = 0,
};
pub const source_vnode_flags_t = packed struct(usize) {
    DELETE: bool = false,
    WRITE: bool = false,
    EXTEND: bool = false,
    ATTRIB: bool = false,
    LINK: bool = false,
    RENAME: bool = false,
    REVOKE: bool = false,
    unused7: u1 = 0,
    FUNLOCK: bool = false,
    unused9: @Int(.unsigned, @bitSizeOf(usize) - 9) = 0,
};
pub const source_timer_flags_t = packed struct(usize) {
    STRICT: bool = false,
    unused1: @Int(.unsigned, @bitSizeOf(usize) - 1) = 0,
};
pub const source_flags_t = packed union(usize) {
    raw: usize,
    MACH_SEND: source_mach_send_flags_t,
    MACH_RECV: source_mach_recv_flags_t,
    MEMORYPRESSURE: source_memorypressure_flags_t,
    PROC: source_proc_flags_t,
    VNODE: source_vnode_flags_t,
    pub const none: source_flags_t = .{ .raw = 0 };
};
pub const source_create = dispatch_source_create;
pub const source_set_event_handler_f = dispatch_source_set_event_handler_f;
pub const source_set_cancel_handler_f = dispatch_source_set_cancel_handler_f;
pub const source_cancel = dispatch_source_cancel;
pub const source_testcancel = dispatch_source_testcancel;
pub const source_get_handle = dispatch_source_get_handle;
pub const source_get_mask = dispatch_source_get_mask;
pub const source_get_data = dispatch_source_get_data;
pub const source_merge_data = dispatch_source_merge_data;
pub const source_set_timer = dispatch_source_set_timer;
pub const source_set_registration_handler_f = dispatch_source_set_registration_handler_f;

const source_s = opaque {
    pub inline fn as_object(source: source_t) object_t {
        return @ptrCast(source);
    }
    pub const set_event_handler = source_set_event_handler_f;
    pub const set_cancel_handler = source_set_cancel_handler_f;
    pub const cancel = source_cancel;
    pub const testcancel = source_testcancel;
    pub const get_handle = source_get_handle;
    pub const get_mask = source_get_mask;
    pub const get_data = source_get_data;
    pub const merge_data = source_merge_data;
    pub const set_timer = source_set_timer;
    pub const set_registration_handler = source_set_registration_handler_f;
};
const source_type_s = opaque {
    pub const DATA_ADD = SOURCE_TYPE_DATA_ADD;
    pub const DATA_OR = SOURCE_TYPE_DATA_OR;
    pub const DATA_REPLACE = SOURCE_TYPE_DATA_REPLACE;
    pub const MACH_SEND = SOURCE_TYPE_MACH_SEND;
    pub const MACH_RECV = SOURCE_TYPE_MACH_RECV;
    pub const MEMORYPRESSURE = SOURCE_TYPE_MEMORYPRESSURE;
    pub const PROC = SOURCE_TYPE_PROC;
    pub const READ = SOURCE_TYPE_READ;
    pub const SIGNAL = SOURCE_TYPE_SIGNAL;
    pub const TIMER = SOURCE_TYPE_TIMER;
    pub const VNODE = SOURCE_TYPE_VNODE;
    pub const WRITE = SOURCE_TYPE_WRITE;
};
extern "c" const _dispatch_source_type_data_add: source_type_s;
extern "c" const _dispatch_source_type_data_or: source_type_s;
extern "c" const _dispatch_source_type_data_replace: source_type_s;
extern "c" const _dispatch_source_type_mach_send: source_type_s;
extern "c" const _dispatch_source_type_mach_recv: source_type_s;
extern "c" const _dispatch_source_type_memorypressure: source_type_s;
extern "c" const _dispatch_source_type_proc: source_type_s;
extern "c" const _dispatch_source_type_read: source_type_s;
extern "c" const _dispatch_source_type_signal: source_type_s;
extern "c" const _dispatch_source_type_timer: source_type_s;
extern "c" const _dispatch_source_type_vnode: source_type_s;
extern "c" const _dispatch_source_type_write: source_type_s;
extern "c" fn dispatch_source_create(type: source_type_t, handle: usize, mask: source_flags_t, queue: ?queue_t) ?source_t;
extern "c" fn dispatch_source_set_event_handler_f(source: source_t, handler: ?function_t) void;
extern "c" fn dispatch_source_set_cancel_handler_f(source: source_t, handler: ?function_t) void;
extern "c" fn dispatch_source_cancel(source: source_t) void;
extern "c" fn dispatch_source_testcancel(source: source_t) isize;
extern "c" fn dispatch_source_get_handle(source: source_t) usize;
extern "c" fn dispatch_source_get_mask(source: source_t) source_flags_t;
extern "c" fn dispatch_source_get_data(source: source_t) usize;
extern "c" fn dispatch_source_merge_data(source: source_t, value: usize) void;
extern "c" fn dispatch_source_set_timer(source: source_t, start: time_t, interval: u64, leeway: u64) void;
extern "c" fn dispatch_source_set_registration_handler_f(source: source_t, handler: ?function_t) void;

// dispatch/time.h
pub const time_t = enum(u64) {
    WALL_NOW = WALLTIME_NOW,
    NOW = TIME_NOW,
    FOREVER = TIME_FOREVER,
    _,

    pub const time = dispatch_time;
    pub const walltime = dispatch_walltime;
    pub const after = dispatch_after_f;
};
pub const WALLTIME_NOW = ~@as(u64, 1);
pub const TIME_NOW: u64 = 0;
pub const TIME_FOREVER = ~@as(u64, 0);
pub const time = dispatch_time;
pub const walltime = dispatch_walltime;

extern "c" fn dispatch_time(when: time_t, delta: i64) time_t;
extern "c" fn dispatch_walltime(when: ?*const std.c.timespec, delta: i64) time_t;

const builtin = @import("builtin");
const std = @import("std");