1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

sync module

This commit is contained in:
Alexander Medvednikov 2019-06-22 21:53:22 +02:00
parent f3a9e2a341
commit ce3d560e09
2 changed files with 28 additions and 0 deletions

15
sync/sync_mac.v Normal file
View 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
View File

@ -0,0 +1,13 @@
module sync
struct Mutex {
}
fn (m Mutex) lock() {
panic('not implemented')
}
fn (m Mutex) unlock() {
panic('not implemented')
}