跳转到内容

std.c.darwin.dispatch

标准库Zig 0.17.0官方原文
源码std/c/darwin/dispatch.zig

第 2 行

std.c.darwin.dispatch._dispatch_main_q

变量

第 122 行

queue_s

std.c.darwin.dispatch._dispatch_queue_attr_concurrent

变量

第 133 行

queue_attr_s

std.c.darwin.dispatch._dispatch_source_type_data_add

常量

第 263 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_data_or

常量

第 264 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_data_replace

常量

第 265 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_mach_recv

常量

第 267 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_mach_send

常量

第 266 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_memorypressure

常量

第 268 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_proc

常量

第 269 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_read

常量

第 270 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_signal

常量

第 271 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_timer

常量

第 272 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_vnode

常量

第 273 行

source_type_s

std.c.darwin.dispatch._dispatch_source_type_write

常量

第 274 行

source_type_s

std.c.darwin.dispatch._os_object_s

容器

第 15 行

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

别名

第 23 行

别名目标 std.c.darwin.dispatch.dispatch_resume

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

别名

第 22 行

别名目标 std.c.darwin.dispatch.dispatch_suspend

std.c.darwin.dispatch._os_object_s.activate

别名

第 21 行

别名目标 std.c.darwin.dispatch.dispatch_activate

std.c.darwin.dispatch._os_object_s.get_context

别名

第 18 行

别名目标 std.c.darwin.dispatch.dispatch_get_context

std.c.darwin.dispatch._os_object_s.release

别名

第 17 行

别名目标 std.c.darwin.dispatch.dispatch_release

std.c.darwin.dispatch._os_object_s.retain

别名

第 16 行

别名目标 std.c.darwin.dispatch.dispatch_retain

std.c.darwin.dispatch._os_object_s.set_context

别名

第 19 行

别名目标 std.c.darwin.dispatch.dispatch_set_context

std.c.darwin.dispatch._os_object_s.set_finalizer

别名

第 20 行

别名目标 std.c.darwin.dispatch.dispatch_set_finalizer_f

std.c.darwin.dispatch._os_object_s.set_target_queue

别名

第 24 行

别名目标 std.c.darwin.dispatch.dispatch_set_target_queue

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

别名

第 13 行

别名目标 std.c.darwin.dispatch.dispatch_resume

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

别名

第 12 行

别名目标 std.c.darwin.dispatch.dispatch_suspend

std.c.darwin.dispatch.activate

别名

第 11 行

别名目标 std.c.darwin.dispatch.dispatch_activate

std.c.darwin.dispatch.after_f

别名

第 99 行

别名目标 std.c.darwin.dispatch.dispatch_after_f

std.c.darwin.dispatch.apply_f

别名

第 66 行

别名目标 std.c.darwin.dispatch.dispatch_apply_f

std.c.darwin.dispatch.async_and_wait_f

别名

第 65 行

别名目标 std.c.darwin.dispatch.dispatch_async_and_wait_f

std.c.darwin.dispatch.async_f

别名

第 63 行

别名目标 std.c.darwin.dispatch.dispatch_async_f

std.c.darwin.dispatch.builtin

常量

第 307 行

std.c.darwin.dispatch.CURRENT_QUEUE_LABEL

原始类型

第 96 行

?[*:0]const u8

std.c.darwin.dispatch.dispatch_activate

函数

第 31 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_after_f

函数

第 140 行

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

参数

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

std.c.darwin.dispatch.dispatch_apply_f

函数

第 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

参数

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

函数

第 119 行

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

参数

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_async_f

函数

第 117 行

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

参数

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_get_context

函数

第 28 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_get_current_queue

函数

第 121 行

extern "c" fn dispatch_get_current_queue() queue_t

std.c.darwin.dispatch.dispatch_get_global_queue

函数

第 123 行

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

参数

identifier: isize
flags: usize

std.c.darwin.dispatch.dispatch_main

函数

第 139 行

extern "c" fn dispatch_main() noreturn

std.c.darwin.dispatch.dispatch_once_f

函数

第 54 行

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

参数

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

std.c.darwin.dispatch.dispatch_queue_attr_make_initially_inactive

函数

第 134 行

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

参数

attr: queue_attr_t

std.c.darwin.dispatch.dispatch_queue_create

函数

第 136 行

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

参数

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

std.c.darwin.dispatch.dispatch_queue_create_with_target

函数

第 135 行

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

参数

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

std.c.darwin.dispatch.dispatch_queue_get_label

函数

第 137 行

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

参数

queue: ?queue_t

std.c.darwin.dispatch.dispatch_release

函数

第 27 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_resume

函数

第 33 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_retain

函数

第 26 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_semaphore_create

函数

第 156 行

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

参数

value: isize

std.c.darwin.dispatch.dispatch_semaphore_signal

函数

第 158 行

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

参数

dsema: semaphore_t

std.c.darwin.dispatch.dispatch_semaphore_wait

函数

第 157 行

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

参数

dsema: semaphore_t
timeout: time_t

std.c.darwin.dispatch.dispatch_set_context

函数

第 29 行

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

参数

object: object_t
context: ?*anyopaque

std.c.darwin.dispatch.dispatch_set_finalizer_f

函数

第 30 行

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

参数

object: object_t
finalizer: ?function_t

std.c.darwin.dispatch.dispatch_set_target_queue

函数

第 138 行

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

参数

object: object_t
queue: ?queue_t

std.c.darwin.dispatch.dispatch_source_cancel

函数

第 278 行

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

参数

source: source_t

std.c.darwin.dispatch.dispatch_source_create

函数

第 275 行

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

参数

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

std.c.darwin.dispatch.dispatch_source_get_data

函数

第 282 行

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

参数

source: source_t

std.c.darwin.dispatch.dispatch_source_get_handle

函数

第 280 行

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

参数

source: source_t

std.c.darwin.dispatch.dispatch_source_get_mask

函数

第 281 行

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

参数

source: source_t

std.c.darwin.dispatch.dispatch_source_merge_data

函数

第 283 行

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

参数

source: source_t
value: usize

std.c.darwin.dispatch.dispatch_source_set_cancel_handler_f

函数

第 277 行

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

参数

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_event_handler_f

函数

第 276 行

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

参数

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_registration_handler_f

函数

第 285 行

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

参数

source: source_t
handler: ?function_t

std.c.darwin.dispatch.dispatch_source_set_timer

函数

第 284 行

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

参数

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

std.c.darwin.dispatch.dispatch_source_testcancel

函数

第 279 行

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

参数

source: source_t

std.c.darwin.dispatch.dispatch_suspend

函数

第 32 行

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

参数

object: object_t

std.c.darwin.dispatch.dispatch_sync_f

函数

第 118 行

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

参数

queue: queue_t
context: ?*anyopaque
work: function_t

std.c.darwin.dispatch.dispatch_time

函数

第 304 行

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

参数

when: time_t
delta: i64

std.c.darwin.dispatch.dispatch_walltime

函数

第 305 行

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

参数

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

std.c.darwin.dispatch.function_t

类型

第 2 行

std.c.darwin.dispatch.get_context

别名

第 8 行

别名目标 std.c.darwin.dispatch.dispatch_get_context

std.c.darwin.dispatch.get_current_queue

别名

第 67 行

别名目标 std.c.darwin.dispatch.dispatch_get_current_queue

std.c.darwin.dispatch.get_global_queue

别名

第 78 行

别名目标 std.c.darwin.dispatch.dispatch_get_global_queue

std.c.darwin.dispatch.get_main_queue

函数

第 68 行

pub inline fn get_main_queue() queue_main_t

std.c.darwin.dispatch.main

别名

第 98 行

别名目标 std.c.darwin.dispatch.dispatch_main

std.c.darwin.dispatch.object_t

类型

第 5 行

std.c.darwin.dispatch.once_f

别名

第 52 行

别名目标 std.c.darwin.dispatch.dispatch_once_f

std.c.darwin.dispatch.once_t

容器

第 36 行

字段

init = 0
done = -1
_

std.c.darwin.dispatch.once_t.once

函数

第 41 行

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

参数

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

std.c.darwin.dispatch.queue_attr_make_initially_inactive

别名

第 92 行

别名目标 std.c.darwin.dispatch.dispatch_queue_attr_make_initially_inactive

std.c.darwin.dispatch.queue_attr_s

容器

第 124 行

std.c.darwin.dispatch.queue_attr_s.as_object

函数

第 125 行

pub inline fn as_object(queue_attr: queue_attr_t) object_t

参数

queue_attr: queue_attr_t

std.c.darwin.dispatch.queue_attr_s.CONCURRENT

别名

第 130 行

别名目标 std.c.darwin.dispatch.QUEUE_CONCURRENT

std.c.darwin.dispatch.queue_attr_s.CONCURRENT_INACTIVE

别名

第 131 行

别名目标 std.c.darwin.dispatch.QUEUE_CONCURRENT_INACTIVE

std.c.darwin.dispatch.queue_attr_s.INACTIVE

别名

第 129 行

别名目标 std.c.darwin.dispatch.QUEUE_INACTIVE

std.c.darwin.dispatch.queue_attr_s.SERIAL

别名

第 128 行

别名目标 std.c.darwin.dispatch.QUEUE_SERIAL

std.c.darwin.dispatch.queue_attr_t

类型

第 79 行

std.c.darwin.dispatch.QUEUE_CONCURRENT

函数

第 86 行

pub inline fn QUEUE_CONCURRENT() queue_attr_t

std.c.darwin.dispatch.QUEUE_CONCURRENT_INACTIVE

函数

第 89 行

pub inline fn QUEUE_CONCURRENT_INACTIVE() queue_attr_t

std.c.darwin.dispatch.queue_concurrent_t

别名

第 62 行

别名目标 std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_create

别名

第 95 行

别名目标 std.c.darwin.dispatch.dispatch_queue_create

std.c.darwin.dispatch.queue_create_with_target

别名

第 94 行

别名目标 std.c.darwin.dispatch.dispatch_queue_create_with_target

std.c.darwin.dispatch.queue_get_label

别名

第 97 行

别名目标 std.c.darwin.dispatch.dispatch_queue_get_label

std.c.darwin.dispatch.queue_global_t

别名

第 58 行

别名目标 std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.QUEUE_INACTIVE

函数

第 83 行

pub inline fn QUEUE_INACTIVE() queue_attr_t

std.c.darwin.dispatch.queue_main_t

别名

第 61 行

别名目标 std.c.darwin.dispatch.queue_serial_t

std.c.darwin.dispatch.queue_priority_t

容器

第 71 行

字段

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

std.c.darwin.dispatch.queue_s

容器

第 101 行

std.c.darwin.dispatch.queue_s.apply

别名

第 108 行

别名目标 std.c.darwin.dispatch.apply_f

std.c.darwin.dispatch.queue_s.as_object

函数

第 102 行

pub inline fn as_object(queue: queue_t) object_t

参数

queue: queue_t

std.c.darwin.dispatch.queue_s.async

别名

第 105 行

别名目标 std.c.darwin.dispatch.async_f

std.c.darwin.dispatch.queue_s.async_and_wait

别名

第 107 行

别名目标 std.c.darwin.dispatch.async_and_wait_f

std.c.darwin.dispatch.queue_s.create

别名

第 114 行

别名目标 std.c.darwin.dispatch.queue_create

std.c.darwin.dispatch.queue_s.create_with_target

别名

第 113 行

别名目标 std.c.darwin.dispatch.queue_create_with_target

std.c.darwin.dispatch.queue_s.get_current

别名

第 109 行

别名目标 std.c.darwin.dispatch.get_current_queue

std.c.darwin.dispatch.queue_s.get_global

别名

第 111 行

别名目标 std.c.darwin.dispatch.get_global_queue

std.c.darwin.dispatch.queue_s.get_label

别名

第 115 行

别名目标 std.c.darwin.dispatch.queue_get_label

std.c.darwin.dispatch.queue_s.get_main

别名

第 110 行

别名目标 std.c.darwin.dispatch.get_main_queue

std.c.darwin.dispatch.queue_s.sync

别名

第 106 行

别名目标 std.c.darwin.dispatch.sync_f

std.c.darwin.dispatch.queue_s.TARGET_DEFAULT

别名

第 112 行

别名目标 std.c.darwin.dispatch.TARGET_QUEUE_DEFAULT

std.c.darwin.dispatch.QUEUE_SERIAL

函数

第 80 行

pub inline fn QUEUE_SERIAL() queue_attr_t

std.c.darwin.dispatch.queue_serial_executor_t

别名

第 59 行

别名目标 std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_serial_t

别名

第 60 行

别名目标 std.c.darwin.dispatch.queue_t

std.c.darwin.dispatch.queue_t

类型

第 57 行

std.c.darwin.dispatch.release

别名

第 7 行

别名目标 std.c.darwin.dispatch.dispatch_release

std.c.darwin.dispatch.retain

别名

第 6 行

别名目标 std.c.darwin.dispatch.dispatch_retain

std.c.darwin.dispatch.semaphore_create

别名

第 144 行

别名目标 std.c.darwin.dispatch.dispatch_semaphore_create

std.c.darwin.dispatch.semaphore_s

容器

第 148 行

std.c.darwin.dispatch.semaphore_s.as_object

函数

第 149 行

pub inline fn as_object(semaphore: semaphore_t) object_t

参数

semaphore: semaphore_t

std.c.darwin.dispatch.semaphore_s.create

别名

第 152 行

别名目标 std.c.darwin.dispatch.semaphore_create

std.c.darwin.dispatch.semaphore_s.signal

别名

第 154 行

别名目标 std.c.darwin.dispatch.semaphore_signal

std.c.darwin.dispatch.semaphore_s.wait

别名

第 153 行

别名目标 std.c.darwin.dispatch.semaphore_wait

std.c.darwin.dispatch.semaphore_signal

别名

第 146 行

别名目标 std.c.darwin.dispatch.dispatch_semaphore_signal

std.c.darwin.dispatch.semaphore_t

类型

第 143 行

std.c.darwin.dispatch.semaphore_wait

别名

第 145 行

别名目标 std.c.darwin.dispatch.dispatch_semaphore_wait

std.c.darwin.dispatch.set_context

别名

第 9 行

别名目标 std.c.darwin.dispatch.dispatch_set_context

std.c.darwin.dispatch.set_finalizer_f

别名

第 10 行

别名目标 std.c.darwin.dispatch.dispatch_set_finalizer_f

std.c.darwin.dispatch.source_cancel

别名

第 225 行

别名目标 std.c.darwin.dispatch.dispatch_source_cancel

std.c.darwin.dispatch.source_create

别名

第 222 行

别名目标 std.c.darwin.dispatch.dispatch_source_create

std.c.darwin.dispatch.source_flags_t

容器

第 213 行

字段

std.c.darwin.dispatch.source_flags_t.none

常量

第 220 行

source_flags_t

std.c.darwin.dispatch.source_get_data

别名

第 229 行

别名目标 std.c.darwin.dispatch.dispatch_source_get_data

std.c.darwin.dispatch.source_get_handle

别名

第 227 行

别名目标 std.c.darwin.dispatch.dispatch_source_get_handle

std.c.darwin.dispatch.source_get_mask

别名

第 228 行

别名目标 std.c.darwin.dispatch.dispatch_source_get_mask

std.c.darwin.dispatch.source_mach_recv_flags_t

容器

第 179 行

字段

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

std.c.darwin.dispatch.source_mach_send_flags_t

容器

第 175 行

字段

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

std.c.darwin.dispatch.source_memorypressure_flags_t

容器

第 182 行

字段

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

std.c.darwin.dispatch.source_merge_data

别名

第 230 行

别名目标 std.c.darwin.dispatch.dispatch_source_merge_data

std.c.darwin.dispatch.source_proc_flags_t

容器

第 188 行

字段

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

容器

第 234 行

std.c.darwin.dispatch.source_s.as_object

函数

第 235 行

pub inline fn as_object(source: source_t) object_t

参数

source: source_t

std.c.darwin.dispatch.source_s.cancel

别名

第 240 行

别名目标 std.c.darwin.dispatch.source_cancel

std.c.darwin.dispatch.source_s.get_data

别名

第 244 行

别名目标 std.c.darwin.dispatch.source_get_data

std.c.darwin.dispatch.source_s.get_handle

别名

第 242 行

别名目标 std.c.darwin.dispatch.source_get_handle

std.c.darwin.dispatch.source_s.get_mask

别名

第 243 行

别名目标 std.c.darwin.dispatch.source_get_mask

std.c.darwin.dispatch.source_s.merge_data

别名

第 245 行

别名目标 std.c.darwin.dispatch.source_merge_data

std.c.darwin.dispatch.source_s.set_cancel_handler

别名

第 239 行

别名目标 std.c.darwin.dispatch.source_set_cancel_handler_f

std.c.darwin.dispatch.source_s.set_event_handler

别名

第 238 行

别名目标 std.c.darwin.dispatch.source_set_event_handler_f

std.c.darwin.dispatch.source_s.set_registration_handler

别名

第 247 行

别名目标 std.c.darwin.dispatch.source_set_registration_handler_f

std.c.darwin.dispatch.source_s.set_timer

别名

第 246 行

别名目标 std.c.darwin.dispatch.source_set_timer

std.c.darwin.dispatch.source_s.testcancel

别名

第 241 行

别名目标 std.c.darwin.dispatch.source_testcancel

std.c.darwin.dispatch.source_set_cancel_handler_f

别名

第 224 行

别名目标 std.c.darwin.dispatch.dispatch_source_set_cancel_handler_f

std.c.darwin.dispatch.source_set_event_handler_f

别名

第 223 行

别名目标 std.c.darwin.dispatch.dispatch_source_set_event_handler_f

std.c.darwin.dispatch.source_set_registration_handler_f

别名

第 232 行

别名目标 std.c.darwin.dispatch.dispatch_source_set_registration_handler_f

std.c.darwin.dispatch.source_set_timer

别名

第 231 行

别名目标 std.c.darwin.dispatch.dispatch_source_set_timer

std.c.darwin.dispatch.source_t

类型

第 161 行

std.c.darwin.dispatch.source_testcancel

别名

第 226 行

别名目标 std.c.darwin.dispatch.dispatch_source_testcancel

std.c.darwin.dispatch.source_timer_flags_t

容器

第 209 行

字段

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

std.c.darwin.dispatch.SOURCE_TYPE_DATA_ADD

常量

第 163 行

std.c.darwin.dispatch.SOURCE_TYPE_DATA_OR

常量

第 164 行

std.c.darwin.dispatch.SOURCE_TYPE_DATA_REPLACE

常量

第 165 行

std.c.darwin.dispatch.SOURCE_TYPE_MACH_RECV

常量

第 167 行

std.c.darwin.dispatch.SOURCE_TYPE_MACH_SEND

常量

第 166 行

std.c.darwin.dispatch.SOURCE_TYPE_MEMORYPRESSURE

常量

第 168 行

std.c.darwin.dispatch.SOURCE_TYPE_PROC

常量

第 169 行

std.c.darwin.dispatch.SOURCE_TYPE_READ

常量

第 170 行

std.c.darwin.dispatch.source_type_s

容器

第 249 行

std.c.darwin.dispatch.source_type_s.DATA_ADD

别名

第 250 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_DATA_ADD

std.c.darwin.dispatch.source_type_s.DATA_OR

别名

第 251 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_DATA_OR

std.c.darwin.dispatch.source_type_s.DATA_REPLACE

别名

第 252 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_DATA_REPLACE

std.c.darwin.dispatch.source_type_s.MACH_RECV

别名

第 254 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_MACH_RECV

std.c.darwin.dispatch.source_type_s.MACH_SEND

别名

第 253 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_MACH_SEND

std.c.darwin.dispatch.source_type_s.MEMORYPRESSURE

别名

第 255 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_MEMORYPRESSURE

std.c.darwin.dispatch.source_type_s.PROC

别名

第 256 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_PROC

std.c.darwin.dispatch.source_type_s.READ

别名

第 257 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_READ

std.c.darwin.dispatch.source_type_s.SIGNAL

别名

第 258 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_SIGNAL

std.c.darwin.dispatch.source_type_s.TIMER

别名

第 259 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_TIMER

std.c.darwin.dispatch.source_type_s.VNODE

别名

第 260 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_VNODE

std.c.darwin.dispatch.source_type_s.WRITE

别名

第 261 行

别名目标 std.c.darwin.dispatch.SOURCE_TYPE_WRITE

std.c.darwin.dispatch.SOURCE_TYPE_SIGNAL

常量

第 171 行

std.c.darwin.dispatch.source_type_t

类型

第 162 行

std.c.darwin.dispatch.SOURCE_TYPE_TIMER

常量

第 172 行

std.c.darwin.dispatch.SOURCE_TYPE_VNODE

常量

第 173 行

std.c.darwin.dispatch.SOURCE_TYPE_WRITE

常量

第 174 行

std.c.darwin.dispatch.source_vnode_flags_t

容器

第 197 行

字段

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

别名

第 308 行

别名目标 std

std.c.darwin.dispatch.sync_f

别名

第 64 行

别名目标 std.c.darwin.dispatch.dispatch_sync_f

std.c.darwin.dispatch.TARGET_QUEUE_DEFAULT

原始类型

第 93 行

?queue_t

std.c.darwin.dispatch.time

别名

第 301 行

别名目标 std.c.darwin.dispatch.dispatch_time

std.c.darwin.dispatch.TIME_FOREVER

常量

第 300 行

std.c.darwin.dispatch.TIME_NOW

常量

第 299 行

u64

std.c.darwin.dispatch.time_t

容器

第 288 行

字段

WALL_NOW = WALLTIME_NOW
NOW = TIME_NOW
FOREVER = TIME_FOREVER
_

std.c.darwin.dispatch.time_t.after

别名

第 296 行

别名目标 std.c.darwin.dispatch.dispatch_after_f

std.c.darwin.dispatch.time_t.time

别名

第 294 行

别名目标 std.c.darwin.dispatch.dispatch_time

std.c.darwin.dispatch.time_t.walltime

别名

第 295 行

别名目标 std.c.darwin.dispatch.dispatch_walltime

std.c.darwin.dispatch.walltime

别名

第 302 行

别名目标 std.c.darwin.dispatch.dispatch_walltime

std.c.darwin.dispatch.WALLTIME_NOW

常量

第 298 行

源码

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");