Mutex: Difference between revisions

m
(→‎{{header|Wren}}: Further blurb.)
Line 818:
\\ we use N$, C and Max as stack variables for each thread
\\ all other variables are shared for module
If C=0 Then if not m.lock() then Print N$+" waiting...................................":Refresh 20: Continue
C++
if c=1 then thread this interval 20
Line 834:
Service=m.lock()
Main.Task 50 {
\\ a block in a thread run alone
{
If Service Then if Keypress(32) then m.unlock: Service=false: Continue
If not Service then if Keypress(32) Then if m.lock() then Service=true : Continue
if PhoneBooth.NowUser$<>"" Then {
Print "Phone:";PhoneBooth.NowUser$: Refresh
} Else.if Service then Print "Service Time": Refresh
}
}
}
CheckIt
404

edits