From 55b16fbdf29b16f9f1a5bc6d8429defe205d1985 Mon Sep 17 00:00:00 2001 From: Mike <45243121+tankf33der@users.noreply.github.com> Date: Wed, 9 Apr 2025 13:13:29 +0300 Subject: [PATCH] sync: remove the call to C.pthread_rwlockattr_setpshared (not needed, since it is the default on POSIX) (#24166) --- vlib/sync/sync_darwin.c.v | 2 -- vlib/sync/sync_default.c.v | 2 -- vlib/sync/sync_freebsd.c.v | 2 -- 3 files changed, 6 deletions(-) diff --git a/vlib/sync/sync_darwin.c.v b/vlib/sync/sync_darwin.c.v index 7ddf3f58c9..05bcb59adf 100644 --- a/vlib/sync/sync_darwin.c.v +++ b/vlib/sync/sync_darwin.c.v @@ -17,7 +17,6 @@ fn C.pthread_mutex_unlock(voidptr) int fn C.pthread_mutex_destroy(voidptr) int fn C.pthread_rwlockattr_init(voidptr) int fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlockattr_setpshared(voidptr, int) int fn C.pthread_rwlock_init(voidptr, voidptr) int fn C.pthread_rwlock_rdlock(voidptr) int fn C.pthread_rwlock_wrlock(voidptr) int @@ -110,7 +109,6 @@ pub fn (mut m RwMutex) init() { should_be_zero(C.pthread_rwlockattr_init(&a.attr)) // Give writer priority over readers C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) - C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE) should_be_zero(C.pthread_rwlock_init(&m.mutex, &a.attr)) } diff --git a/vlib/sync/sync_default.c.v b/vlib/sync/sync_default.c.v index 2cd73191a3..ddbc5de82a 100644 --- a/vlib/sync/sync_default.c.v +++ b/vlib/sync/sync_default.c.v @@ -21,7 +21,6 @@ fn C.pthread_mutex_unlock(voidptr) int fn C.pthread_mutex_destroy(voidptr) int fn C.pthread_rwlockattr_init(voidptr) int fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlockattr_setpshared(voidptr, int) int fn C.pthread_rwlockattr_destroy(voidptr) int fn C.pthread_rwlock_init(voidptr, voidptr) int fn C.pthread_rwlock_rdlock(voidptr) int @@ -97,7 +96,6 @@ pub fn (mut m RwMutex) init() { C.pthread_rwlockattr_init(&a.attr) // Give writer priority over readers C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) - C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE) C.pthread_rwlock_init(&m.mutex, &a.attr) C.pthread_rwlockattr_destroy(&a.attr) // destroy the attr when done } diff --git a/vlib/sync/sync_freebsd.c.v b/vlib/sync/sync_freebsd.c.v index 530849c244..11c90aab4d 100644 --- a/vlib/sync/sync_freebsd.c.v +++ b/vlib/sync/sync_freebsd.c.v @@ -21,7 +21,6 @@ fn C.pthread_mutex_unlock(voidptr) int fn C.pthread_mutex_destroy(voidptr) int fn C.pthread_rwlockattr_init(voidptr) int fn C.pthread_rwlockattr_setkind_np(voidptr, int) int -fn C.pthread_rwlockattr_setpshared(voidptr, int) int fn C.pthread_rwlockattr_destroy(voidptr) int fn C.pthread_rwlock_init(voidptr, voidptr) int fn C.pthread_rwlock_rdlock(voidptr) int @@ -95,7 +94,6 @@ pub fn (mut m RwMutex) init() { C.pthread_rwlockattr_init(&a.attr) // Give writer priority over readers C.pthread_rwlockattr_setkind_np(&a.attr, C.PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP) - C.pthread_rwlockattr_setpshared(&a.attr, C.PTHREAD_PROCESS_PRIVATE) C.pthread_rwlock_init(&m.mutex, &a.attr) C.pthread_rwlockattr_destroy(&a.attr) // destroy the attr when done }