live: cleanup
parent
7c9bb44784
commit
2dbb4c2ca7
|
@ -3,7 +3,6 @@
|
||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
module builtin
|
module builtin
|
||||||
|
|
||||||
|
|
||||||
//pub fn vsyscall(id int
|
//pub fn vsyscall(id int
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
|
@ -401,3 +401,10 @@ fn C.WaitForSingleObject(voidptr, int) int
|
||||||
|
|
||||||
|
|
||||||
fn C.ReleaseMutex(voidptr) bool
|
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
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ pub mut:
|
||||||
cb_after FNLiveReloadCB = 0 // executed after a reload try happened, even if failed
|
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_before FNLiveReloadCB = 0 // executed before lib reload, in the mutex section
|
||||||
cb_locked_after FNLiveReloadCB = 0 // executed after 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
|
// LiveReloadInfo.live_linkfn should be called by the reloader
|
||||||
|
|
|
@ -8,9 +8,6 @@ import live
|
||||||
|
|
||||||
// The live reloader code is implemented here.
|
// 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()
|
// 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 {
|
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', '')
|
file_base := os.file_name(original).replace('.v', '')
|
||||||
|
|
|
@ -3,11 +3,6 @@
|
||||||
// that can be found in the LICENSE file.
|
// that can be found in the LICENSE file.
|
||||||
module sync
|
module sync
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
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.
|
// [init_with=new_mutex] // TODO: implement support for this struct attribute, and disallow Mutex{} from outside the sync.new_mutex() function.
|
||||||
[ref_only]
|
[ref_only]
|
||||||
pub struct Mutex {
|
pub struct Mutex {
|
||||||
|
|
Loading…
Reference in New Issue