Guest User

Untitled

a guest
Jun 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. -module(myring).
  2. -export([start/1, start_proc/2]).
  3.  
  4. start(Num) ->
  5. start_proc(Num, self()).
  6.  
  7. start_proc(0, Pid) ->
  8. Pid ! ok;
  9. start_proc(Num, Pid) ->
  10. NPid = spawn(?MODULE, start_proc, [Num -1, Pid]),
  11. NPid ! ok,
  12. receive ok ->
  13. ok end.
Add Comment
Please, Sign In to add comment