aboutsummaryrefslogtreecommitdiff
path: root/examples/threads
diff options
context:
space:
mode:
Diffstat (limited to 'examples/threads')
-rw-r--r--examples/threads/threads.tm16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/threads/threads.tm b/examples/threads/threads.tm
index 99bb83b4..5949a5cc 100644
--- a/examples/threads/threads.tm
+++ b/examples/threads/threads.tm
@@ -13,11 +13,11 @@ struct Mutex(_mutex:@Memory):
func do_locked(m:Mutex, fn:func(); inline):
inline C {
- pthread_mutex_lock((pthread_mutex_t*)_$m.$_mutex);
+ pthread_mutex_lock((pthread_mutex_t*)_$m._mutex);
}
fn()
inline C {
- pthread_mutex_unlock((pthread_mutex_t*)_$m.$_mutex);
+ pthread_mutex_unlock((pthread_mutex_t*)_$m._mutex);
}
struct ThreadCondition(_cond:@Memory):
@@ -33,17 +33,17 @@ struct ThreadCondition(_cond:@Memory):
func wait(c:ThreadCondition, m:Mutex; inline):
inline C {
- pthread_cond_wait((pthread_cond_t*)_$c.$_cond, (pthread_mutex_t*)_$m.$_mutex);
+ pthread_cond_wait((pthread_cond_t*)_$c._cond, (pthread_mutex_t*)_$m._mutex);
}
func signal(c:ThreadCondition; inline):
inline C {
- pthread_cond_signal((pthread_cond_t*)_$c.$_cond);
+ pthread_cond_signal((pthread_cond_t*)_$c._cond);
}
func broadcast(c:ThreadCondition; inline):
inline C {
- pthread_cond_broadcast((pthread_cond_t*)_$c.$_cond);
+ pthread_cond_broadcast((pthread_cond_t*)_$c._cond);
}
struct Guard(mutex=Mutex.new(), cond=ThreadCondition.new()):
@@ -66,17 +66,17 @@ struct PThread(_thread:@Memory):
func join(t:PThread):
inline C {
- pthread_join(*(pthread_t*)_$t.$_thread, NULL);
+ pthread_join(*(pthread_t*)_$t._thread, NULL);
}
func cancel(t:PThread):
inline C {
- pthread_cancel(*(pthread_t*)_$t.$_thread);
+ pthread_cancel(*(pthread_t*)_$t._thread);
}
func detatch(t:PThread):
inline C {
- pthread_detach(*(pthread_t*)_$t.$_thread);
+ pthread_detach(*(pthread_t*)_$t._thread);
}
func main():