mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
add pthread_key functions
This commit is contained in:
parent
8ea2b40e5f
commit
ebf2a7e9b9
@ -271,6 +271,10 @@ pub extern "c" fn pthread_atfork(
|
||||
parent: ?fn () callconv(.C) void,
|
||||
child: ?fn () callconv(.C) void,
|
||||
) c_int;
|
||||
pub extern "c" fn pthread_key_create(key: *pthread_key_t, destructor: ?fn (value: *c_void) callconv(.C) void) c_int;
|
||||
pub extern "c" fn pthread_key_delete(key: pthread_key_t) c_int;
|
||||
pub extern "c" fn pthread_getspecific(key: pthread_key_t) ?*c_void;
|
||||
pub extern "c" fn pthread_setspecific(key: pthread_key_t, value: ?*c_void) c_int;
|
||||
pub extern "c" fn sem_init(sem: *sem_t, pshared: c_int, value: c_uint) c_int;
|
||||
pub extern "c" fn sem_destroy(sem: *sem_t) c_int;
|
||||
pub extern "c" fn sem_post(sem: *sem_t) c_int;
|
||||
|
||||
@ -33,6 +33,7 @@ pub const pthread_spinlock_t = extern struct {
|
||||
pub const pthread_attr_t = extern struct {
|
||||
inner: ?*c_void = null,
|
||||
};
|
||||
pub const pthread_key_t = c_int;
|
||||
|
||||
pub const sem_t = ?*opaque {};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user