Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- declare
- fun {p1 L}
- case L
- of nil then nil
- [] X|Xs then
- if X=='ping' then
- {Delay 500}
- {Browse 'pong'}
- 1|{p1 Xs}
- end
- if X=='pong' then
- {Delay 500}
- {Browse 'ping'}
- 'ping'|{p1 Xs}
- end
- end
- end
- declare
- fun {p2 L}
- case L
- of nil then nil
- [] X|Xs then
- if X=='ping' then
- {Delay 500}
- {Browse 'pong'}
- 'pong'|{p2 Xs}
- end
- if X=='pong' then
- {Delay 500}
- {Browse 'ping'}
- 'ping'|{p2 Xs}
- end
- end
- end
- declare
- proc {gme p1 p2}
- {p1 thread {p2 'ping'} end}
- %{p2 thread {p1} end}
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement