Permalink
Browse files

Merge branch 'master' into r14

  • Loading branch information...
ferd committed Apr 24, 2012
2 parents 5f10e04 + 4b33eda commit 74edeaff45cfee23d8949c3bd7d02cb3d3337983
Showing with 4 additions and 4 deletions.
  1. +1 −1 README.markdown
  2. +1 −1 src/dispcount_serv.erl
  3. +1 −1 src/dispcount_watcher.erl
  4. +1 −1 test/prop_dispatch.erl
View
@@ -101,7 +101,7 @@ To check resources back in, the behaviour needs to implement the following:
In this case, what happens is that we make sure that the resource that is being sent back to us is the right one. The first function clause makes sure that we only receive a reference after we've distributed one, and we then accept that one. If we receive extraneous references (maybe someone called the `checkin/3` function twice?), we ignore the result.
-The second clause here is entirely optional and defensive programming. Note that checking a resource in is a synchronous operation.
+The second clause here is entirely optional and defensive programming. Note that checking a resource in is an asynchronous operation.
The next call is the `dead/1` function:
View
@@ -39,7 +39,7 @@ init({Parent, Name, {M,A}, Opts}) ->
proplists:get_value(restart,Opts,permanent),
proplists:get_value(shutdown,Opts,5000),
worker,
- [dispcount_watcher,M]}]}, % <- check to make sure this can survive stuff
+ [dispcount_watcher,M]}]}, % <- check to make sure this can survive relups
ChildSpec = {watchers_sup, {watchers_sup, start_link, [SupSpec]},
permanent, infinity, supervisor, [watchers_sup]},
self() ! continue_init,
@@ -142,7 +142,7 @@ init(Id,Conf,M,A) ->
end.
dispatch_id(Num) ->
- erlang:phash2({os:timestamp(),self()}, Num) + 1.
+ erlang:phash2({now(),self()}, Num) + 1.
is_free(Tid, Id) ->
%% We optionally keep a tiny message queue in there,
View
@@ -10,7 +10,7 @@ init([Tid]) ->
checkout(_From, Id) ->
{ok, Id, Id}.
-checkin(Id, undefined) ->
+checkin(Id, Id) ->
{ok, Id};
checkin(_SomeId, Id) ->
{ignore, Id}.

0 comments on commit 74edeaf

Please sign in to comment.