From ce3d560e0973f5668bdaa064d08c4fb461bcd959 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Sat, 22 Jun 2019 21:53:22 +0200 Subject: [PATCH] sync module --- sync/sync_mac.v | 15 +++++++++++++++ sync/sync_win.v | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 sync/sync_mac.v create mode 100644 sync/sync_win.v diff --git a/sync/sync_mac.v b/sync/sync_mac.v new file mode 100644 index 0000000000..ab4fa03523 --- /dev/null +++ b/sync/sync_mac.v @@ -0,0 +1,15 @@ +module sync + +#include +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) +} + diff --git a/sync/sync_win.v b/sync/sync_win.v new file mode 100644 index 0000000000..aec69932d9 --- /dev/null +++ b/sync/sync_win.v @@ -0,0 +1,13 @@ +module sync + +struct Mutex { +} + +fn (m Mutex) lock() { +panic('not implemented') +} + +fn (m Mutex) unlock() { +panic('not implemented') +} +