mirror of
https://github.com/PeterCamilleri/fOOrth
synced 2024-11-16 07:47:56 +01:00
UG update; Mutex class and snippet.
This commit is contained in:
parent
2fa48c8a92
commit
23b329818f
2 changed files with 12 additions and 0 deletions
Binary file not shown.
12
docs/snippets/mutex.foorth
Normal file
12
docs/snippets/mutex.foorth
Normal 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 @ ;
|
Loading…
Reference in a new issue