summaryrefslogtreecommitdiff
path: root/src/counter.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/counter.erl')
-rw-r--r--src/counter.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/counter.erl b/src/counter.erl
index b8db3e1..e566d6c 100644
--- a/src/counter.erl
+++ b/src/counter.erl
@@ -5,7 +5,7 @@
-define(MAXCOUNT, 32767).
start() ->
- register(counterPid, spawn_link(?MODULE, counter, [])).
+ register(?MODULE, spawn_link(?MODULE, counter, [])).
counter() ->
process_flag(trap_exit, true),
@@ -29,13 +29,13 @@ count(N) ->
end.
set({present, N}) ->
- counterPid ! {set, N+1}.
+ ?MODULE ! {set, N+1}.
next() ->
- counterPid ! {next, self()},
+ ?MODULE ! {next, self()},
receive
{next, N} -> {present, N}
end.
stop() ->
- counterPid ! {stop}.
+ ?MODULE ! {stop}.