sync module
parent
f3a9e2a341
commit
ce3d560e09
|
@ -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)
|
||||
}
|
||||
|
|
@ -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