Skip to content
Permalink
Browse files

Fixed off-by-one error in enforcing W/R

  • Loading branch information...
lethain committed Dec 2, 2009
1 parent 7a5dc77 commit 0519d767fed3ff416a0c6cc6c4cf0b17ec58466d
Showing with 2 additions and 2 deletions.
  1. +2 −2 kvs.erl
@@ -85,7 +85,7 @@ store(Store = #kvs_store{data=Data, pending_reads=Reads, pending_writes=Writes})
store(Store);
{_Sender, retrieved, Client, Key, Value} ->
case proplists:get_value({Client, Key}, Reads) of
{1, Values, _Timestamp} ->
{0, Values, _Timestamp} ->
Freq = lists:foldr(fun(X, Acc) ->
case proplists:get_value(X, Acc) of
undefined -> [{X, 1} | Acc];
@@ -118,7 +118,7 @@ store(Store = #kvs_store{data=Data, pending_reads=Reads, pending_writes=Writes})
case Count of
undefined ->
store(Store);
1 ->
0 ->
Client ! {self(), received, {set, Key, Value}},
store(Store#kvs_store{
pending_writes=proplists:delete({Key, Value}, Writes)});

0 comments on commit 0519d76

Please sign in to comment.
You can’t perform that action at this time.