From e0a386fa8f884610ed1005462740d5db57d4ad3e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 19 Mar 2025 16:22:29 -0400 Subject: Replace "begin"/"end" with "do_begin"/"do_end" --- examples/pthreads/pthreads.tm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/pthreads') diff --git a/examples/pthreads/pthreads.tm b/examples/pthreads/pthreads.tm index 13d94e40..b4671d4c 100644 --- a/examples/pthreads/pthreads.tm +++ b/examples/pthreads/pthreads.tm @@ -58,14 +58,14 @@ struct IntQueue(_queue:@[Int], _mutex:@pthread_mutex_t, _cond:@pthread_cond_t): return IntQueue(@initial, pthread_mutex_t.new(), pthread_cond_t.new()) func give(q:IntQueue, n:Int): - begin: q._mutex:lock() - end: q._mutex:unlock() + do_begin: q._mutex:lock() + do_end: q._mutex:unlock() do: q._queue:insert(n) q._cond:signal() func take(q:IntQueue -> Int): - begin: q._mutex:lock() - end: q._mutex:unlock() + do_begin: q._mutex:lock() + do_end: q._mutex:unlock() do: repeat: if n := q._queue:pop(1): @@ -79,8 +79,8 @@ func main(): say_mutex := pthread_mutex_t.new() announce := func(speaker:Text, text:Text): - begin: say_mutex:lock() - end: say_mutex:unlock() + do_begin: say_mutex:lock() + do_end: say_mutex:unlock() do: say("$\033[2m[$speaker]$\033[m $text") worker := pthread_t.new(func(): -- cgit v1.2.3