diff --git a/prototype/poc-machi/src/machi_flu0.erl b/prototype/poc-machi/src/machi_flu0.erl index 520bdc3..b38040b 100644 --- a/prototype/poc-machi/src/machi_flu0.erl +++ b/prototype/poc-machi/src/machi_flu0.erl @@ -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(), diff --git a/prototype/poc-machi/test/machi_flu0_test.erl b/prototype/poc-machi/test/machi_flu0_test.erl index d7117f1..5b18d7c 100644 --- a/prototype/poc-machi/test/machi_flu0_test.erl +++ b/prototype/poc-machi/test/machi_flu0_test.erl @@ -53,12 +53,12 @@ concuerror2_test() -> concuerror3_test() -> Me = self(), - Fun = fun() -> {ok, F1} = machi_flu0:start_link(one), - ok = machi_flu0:stop(F1), - Me ! done - end, - P1 = spawn(Fun), - P2 = spawn(Fun), + Inner = fun(Name) -> {ok, F1} = machi_flu0:start_link(Name), + ok = machi_flu0:stop(F1), + Me ! done + end, + P1 = spawn(fun() -> Inner(one) end), + P2 = spawn(fun() -> Inner(two) end), [receive done -> ok end || _ <- [P1, P2]], ok.