mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
sync module
This commit is contained in:
parent
f3a9e2a341
commit
ce3d560e09
2 changed files with 28 additions and 0 deletions
15
sync/sync_mac.v
Normal file
15
sync/sync_mac.v
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
module sync
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
|
struct Mutex {
|
||||||
|
mutex C.pthread_mutex_t
|
||||||
|
}
|
||||||
|
|
||||||
|
fn (m Mutex) lock() {
|
||||||
|
C.pthread_mutex_lock(&m.mutex)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn (m Mutex) unlock() {
|
||||||
|
C.pthread_mutex_unlock(&m.mutex)
|
||||||
|
}
|
||||||
|
|
13
sync/sync_win.v
Normal file
13
sync/sync_win.v
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
module sync
|
||||||
|
|
||||||
|
struct Mutex {
|
||||||
|
}
|
||||||
|
|
||||||
|
fn (m Mutex) lock() {
|
||||||
|
panic('not implemented')
|
||||||
|
}
|
||||||
|
|
||||||
|
fn (m Mutex) unlock() {
|
||||||
|
panic('not implemented')
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue