Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Events/Oz/events-1.oz
Normal file
29
Task/Events/Oz/events-1.oz
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
declare
|
||||
fun {NewEvent}
|
||||
{NewCell _}
|
||||
end
|
||||
|
||||
proc {SignalEvent Event}
|
||||
@Event = unit
|
||||
end
|
||||
|
||||
proc {ResetEvent Event}
|
||||
Event := _
|
||||
end
|
||||
|
||||
proc {WaitEvent Event}
|
||||
{Wait @Event}
|
||||
end
|
||||
|
||||
E = {NewEvent}
|
||||
in
|
||||
thread
|
||||
{System.showInfo "[2] Waiting for event..."}
|
||||
{WaitEvent E}
|
||||
{System.showInfo "[2] Received event."}
|
||||
end
|
||||
|
||||
{System.showInfo "[1] Waiting 1 second..."}
|
||||
{Delay 1000}
|
||||
{System.showInfo "[1] Signaling event."}
|
||||
{SignalEvent E}
|
||||
13
Task/Events/Oz/events-2.oz
Normal file
13
Task/Events/Oz/events-2.oz
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
declare
|
||||
E
|
||||
in
|
||||
thread
|
||||
{System.showInfo "[2] Waiting for event..."}
|
||||
{Wait E}
|
||||
{System.showInfo "[2] Received event."}
|
||||
end
|
||||
|
||||
{System.showInfo "[1] Waiting 1 second..."}
|
||||
{Delay 1000}
|
||||
{System.showInfo "[1] Signaling event."}
|
||||
E = unit
|
||||
20
Task/Events/Oz/events-3.oz
Normal file
20
Task/Events/Oz/events-3.oz
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
declare
|
||||
MyPort
|
||||
in
|
||||
thread
|
||||
MyStream
|
||||
in
|
||||
{NewPort ?MyStream ?MyPort}
|
||||
{System.showInfo "[2] Waiting for event..."}
|
||||
for Event in MyStream do
|
||||
{System.showInfo "[2] Received event."}
|
||||
{System.showInfo "[2] Waiting for event again..."}
|
||||
end
|
||||
end
|
||||
|
||||
for do
|
||||
{System.showInfo "[1] Waiting 1 second..."}
|
||||
{Delay 1000}
|
||||
{System.showInfo "[1] Signaling event."}
|
||||
{Port.send MyPort unit}
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue