sync module

pull/362/head
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 100644
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 100644
View File

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