diff --git a/vlib/builtin/builtin_nix.c.v b/vlib/builtin/builtin_nix.c.v index ef5b153630..77b6ed622c 100644 --- a/vlib/builtin/builtin_nix.c.v +++ b/vlib/builtin/builtin_nix.c.v @@ -3,7 +3,6 @@ // that can be found in the LICENSE file. module builtin - //pub fn vsyscall(id int // diff --git a/vlib/builtin/cfns.c.v b/vlib/builtin/cfns.c.v index 7225d03373..fd069629f3 100644 --- a/vlib/builtin/cfns.c.v +++ b/vlib/builtin/cfns.c.v @@ -401,3 +401,10 @@ fn C.WaitForSingleObject(voidptr, int) int fn C.ReleaseMutex(voidptr) bool + +// pthread.h + +fn C.pthread_mutex_init(voidptr, voidptr) int +fn C.pthread_mutex_lock(voidptr) int +fn C.pthread_mutex_unlock(voidptr) int + diff --git a/vlib/live/common.v b/vlib/live/common.v index 7eaa585134..374d8d78e8 100644 --- a/vlib/live/common.v +++ b/vlib/live/common.v @@ -26,6 +26,7 @@ pub mut: cb_after FNLiveReloadCB = 0 // executed after a reload try happened, even if failed cb_locked_before FNLiveReloadCB = 0 // executed before lib reload, in the mutex section cb_locked_after FNLiveReloadCB = 0 // executed after lib reload, in the mutex section + user_ptr voidptr = 0 // you can set it to anything, then retrieve it in the cb_ fns } // LiveReloadInfo.live_linkfn should be called by the reloader diff --git a/vlib/live/executable/reloader.v b/vlib/live/executable/reloader.v index 14a3fd1d29..9d8f3df0b8 100644 --- a/vlib/live/executable/reloader.v +++ b/vlib/live/executable/reloader.v @@ -8,9 +8,6 @@ import live // The live reloader code is implemented here. -fn C.pthread_mutex_unlock(mtx voidptr) -fn C.pthread_mutex_lock(mtx voidptr) - // NB: new_live_reload_info will be called by generated C code inside main() pub fn new_live_reload_info(original string, vexe string, vopts string, live_fn_mutex voidptr, live_linkfn live.FNLinkLiveSymbols) &live.LiveReloadInfo { file_base := os.file_name(original).replace('.v', '') diff --git a/vlib/sync/sync_nix.c.v b/vlib/sync/sync_nix.c.v index ad6dedf413..cb14de141b 100644 --- a/vlib/sync/sync_nix.c.v +++ b/vlib/sync/sync_nix.c.v @@ -3,11 +3,6 @@ // that can be found in the LICENSE file. module sync -#include -fn C.pthread_mutex_init(voidptr, voidptr) int -fn C.pthread_mutex_lock(voidptr) int -fn C.pthread_mutex_unlock(voidptr) int - // [init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function. [ref_only] pub struct Mutex {