UG update; Mutex class and snippet.

This commit is contained in:
Peter Camilleri 2015-06-12 22:05:40 -04:00
parent 2fa48c8a92
commit 23b329818f
2 changed files with 12 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,12 @@
( a_count test_mutex 100*a_count )
: test_mutex
0 var: ctr
Array .new{{
x .to_s Thread .new{{
0 100 do
Mutex .do{{ ctr @ 1+ ctr ! }}
0.001 .sleep
loop
}}
}} .each{{ v .join }}
ctr @ ;