mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
sync module
This commit is contained in:
parent
f3a9e2a341
commit
ce3d560e09
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…
Reference in New Issue
Block a user