From 294b712e6dabc722772f86aaa9d0faaa08c14717 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 11 Mar 2025 13:18:30 -0400 Subject: Don't use '$' prefix for field names --- examples/threads/threads.tm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/threads/threads.tm') 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(): -- cgit v1.2.3