| author | |
| committer | |
| log | f8e9593851d4305a24836bdd3636255fb8c4243a |
| tree | ab1197369482ec22d3d9250406a4faedbeb23a9d |
| parent | a2a91199d77116710f9ff85be291004375be314f |
| signature |
* `pthread_mutex_*` and friends are also invalid then but they're not
currently tested (and there's no wasi prong in `pthread_mutex_t`)2 files changed, 9 insertions(+), 9 deletions(-)
lib/std/c.zig+5-5| ... | @@ -10977,11 +10977,11 @@ else | ... | @@ -10977,11 +10977,11 @@ else |
| 10977 | 10977 | ||
| 10978 | pub const PTHREAD_PROCESS_SHARED: c_int = 1; | 10978 | pub const PTHREAD_PROCESS_SHARED: c_int = 1; |
| 10979 | 10979 | ||
| 10980 | pub extern "c" fn pthread_spin_init(spin: *pthread_spinlock_t, pshared: c_int) E; | 10980 | pub extern "c" fn pthread_spin_init(spin: *pthread_spinlock_t, pshared: c_int) c_int; |
| 10981 | pub extern "c" fn pthread_spin_lock(spin: *pthread_spinlock_t) E; | 10981 | pub extern "c" fn pthread_spin_lock(spin: *pthread_spinlock_t) c_int; |
| 10982 | pub extern "c" fn pthread_spin_unlock(spin: *pthread_spinlock_t) E; | 10982 | pub extern "c" fn pthread_spin_unlock(spin: *pthread_spinlock_t) c_int; |
| 10983 | pub extern "c" fn pthread_spin_trylock(spin: *pthread_spinlock_t) E; | 10983 | pub extern "c" fn pthread_spin_trylock(spin: *pthread_spinlock_t) c_int; |
| 10984 | pub extern "c" fn pthread_spin_destroy(spin: *pthread_spinlock_t) E; | 10984 | pub extern "c" fn pthread_spin_destroy(spin: *pthread_spinlock_t) c_int; |
| 10985 | 10985 | ||
| 10986 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = .{}; | 10986 | pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = .{}; |
| 10987 | pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E; | 10987 | pub extern "c" fn pthread_mutex_lock(mutex: *pthread_mutex_t) E; |
test/c/pthread.zig+4-4| ... | @@ -12,9 +12,9 @@ test "pthread_spinlock_t" { | ... | @@ -12,9 +12,9 @@ test "pthread_spinlock_t" { |
| 12 | _ = c.pthread_spin_init(&spin, c.PTHREAD_PROCESS_PRIVATE); | 12 | _ = c.pthread_spin_init(&spin, c.PTHREAD_PROCESS_PRIVATE); |
| 13 | defer _ = c.pthread_spin_destroy(&spin); | 13 | defer _ = c.pthread_spin_destroy(&spin); |
| 14 | 14 | ||
| 15 | try std.testing.expectEqual(.SUCCESS, c.pthread_spin_trylock(&spin)); | 15 | try std.testing.expectEqual(@intFromEnum(c.E.SUCCESS), c.pthread_spin_trylock(&spin)); |
| 16 | try std.testing.expectEqual(.SUCCESS, c.pthread_spin_unlock(&spin)); | 16 | try std.testing.expectEqual(@intFromEnum(c.E.SUCCESS), c.pthread_spin_unlock(&spin)); |
| 17 | 17 | ||
| 18 | try std.testing.expectEqual(.SUCCESS, c.pthread_spin_lock(&spin)); | 18 | try std.testing.expectEqual(@intFromEnum(c.E.SUCCESS), c.pthread_spin_lock(&spin)); |
| 19 | try std.testing.expectEqual(.SUCCESS, c.pthread_spin_unlock(&spin)); | 19 | try std.testing.expectEqual(@intFromEnum(c.E.SUCCESS), c.pthread_spin_unlock(&spin)); |
| 20 | } | 20 | } |