Skip to content

Commit 55b16fb

Browse files
authored
sync: remove the call to C.pthread_rwlockattr_setpshared (not needed, since it is the default on POSIX) (#24166)
1 parent c675963 commit 55b16fb

File tree

3 files changed

+0
-6
lines changed

3 files changed

+0
-6
lines changed

vlib/sync/sync_darwin.c.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ fn C.pthread_mutex_unlock(voidptr) int
1717
fn C.pthread_mutex_destroy(voidptr) int
1818
fn C.pthread_rwlockattr_init(voidptr) int
1919
fn C.pthread_rwlockattr_setkind_np(voidptr, int) int
20-
fn C.pthread_rwlockattr_setpshared(voidptr, int) int
2120
fn C.pthread_rwlock_init(voidptr, voidptr) int
2221
fn C.pthread_rwlock_rdlock(voidptr) int
2322
fn C.pthread_rwlock_wrlock(voidptr) int
@@ -110,7 +109,6 @@ pub fn (mut m RwMutex) init() {
110109
should_be_zero(C.pthread_rwlockattr_init(&a.attr))
111110
// Give writer priority over readers
112111
C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
113-
C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE)
114112
should_be_zero(C.pthread_rwlock_init(&m.mutex, &a.attr))
115113
}
116114

vlib/sync/sync_default.c.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn C.pthread_mutex_unlock(voidptr) int
2121
fn C.pthread_mutex_destroy(voidptr) int
2222
fn C.pthread_rwlockattr_init(voidptr) int
2323
fn C.pthread_rwlockattr_setkind_np(voidptr, int) int
24-
fn C.pthread_rwlockattr_setpshared(voidptr, int) int
2524
fn C.pthread_rwlockattr_destroy(voidptr) int
2625
fn C.pthread_rwlock_init(voidptr, voidptr) int
2726
fn C.pthread_rwlock_rdlock(voidptr) int
@@ -97,7 +96,6 @@ pub fn (mut m RwMutex) init() {
9796
C.pthread_rwlockattr_init(&a.attr)
9897
// Give writer priority over readers
9998
C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
100-
C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE)
10199
C.pthread_rwlock_init(&m.mutex, &a.attr)
102100
C.pthread_rwlockattr_destroy(&a.attr) // destroy the attr when done
103101
}

vlib/sync/sync_freebsd.c.v

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ fn C.pthread_mutex_unlock(voidptr) int
2121
fn C.pthread_mutex_destroy(voidptr) int
2222
fn C.pthread_rwlockattr_init(voidptr) int
2323
fn C.pthread_rwlockattr_setkind_np(voidptr, int) int
24-
fn C.pthread_rwlockattr_setpshared(voidptr, int) int
2524
fn C.pthread_rwlockattr_destroy(voidptr) int
2625
fn C.pthread_rwlock_init(voidptr, voidptr) int
2726
fn C.pthread_rwlock_rdlock(voidptr) int
@@ -95,7 +94,6 @@ pub fn (mut m RwMutex) init() {
9594
C.pthread_rwlockattr_init(&a.attr)
9695
// Give writer priority over readers
9796
C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
98-
C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE)
9997
C.pthread_rwlock_init(&m.mutex, &a.attr)
10098
C.pthread_rwlockattr_destroy(&a.attr) // destroy the attr when done
10199
}

0 commit comments

Comments
 (0)