WIP: Fix flu0 name registration

This commit is contained in:
Scott Lystig Fritchie 2014-10-27 18:35:47 +09:00
parent 500a13a01d
commit 3e499e241a
2 changed files with 7 additions and 6 deletions

View file

@ -120,6 +120,7 @@ init([Name]) ->
lclock_init(),
[(catch exit(whereis(Name), kill)) || _ <- lists:seq(1,2)],
erlang:yield(),
register(Name, self()),
{ok, #state{name=Name,
proj_epoch=-42,
proj_store_pub=orddict:new(),

View file

@ -53,12 +53,12 @@ concuerror2_test() ->
concuerror3_test() ->
Me = self(),
Fun = fun() -> {ok, F1} = machi_flu0:start_link(one),
Inner = fun(Name) -> {ok, F1} = machi_flu0:start_link(Name),
ok = machi_flu0:stop(F1),
Me ! done
end,
P1 = spawn(Fun),
P2 = spawn(Fun),
P1 = spawn(fun() -> Inner(one) end),
P2 = spawn(fun() -> Inner(two) end),
[receive done -> ok end || _ <- [P1, P2]],
ok.