PULSE bugfix: race with finish_init message
This commit is contained in:
parent
a294a0eff0
commit
bcc6cf1e6a
2 changed files with 3 additions and 1 deletions
|
@ -135,6 +135,9 @@ init({Dir, ExpPageSize, ExpMaxMem}) ->
|
||||||
self() ! finish_init, % TODO
|
self() ! finish_init, % TODO
|
||||||
{ok, State}.
|
{ok, State}.
|
||||||
|
|
||||||
|
handle_call(Call, From, #state{max_logical_page=unknown} = State) ->
|
||||||
|
{noreply, NewState} = handle_info(finish_init, State),
|
||||||
|
handle_call(Call, From, NewState);
|
||||||
handle_call({write, ClientEpoch, _LogicalPN, _PageBin}, _From,
|
handle_call({write, ClientEpoch, _LogicalPN, _PageBin}, _From,
|
||||||
#state{min_epoch=MinEpoch} = State)
|
#state{min_epoch=MinEpoch} = State)
|
||||||
when ClientEpoch < MinEpoch ->
|
when ClientEpoch < MinEpoch ->
|
||||||
|
|
|
@ -50,7 +50,6 @@ get(Pid, NumPages) ->
|
||||||
|
|
||||||
init({FLUs}) ->
|
init({FLUs}) ->
|
||||||
MLP = get_max_logical_page(FLUs),
|
MLP = get_max_logical_page(FLUs),
|
||||||
io:format(user, "~s:init: MLP = ~p\n", [?MODULE, MLP]),
|
|
||||||
{ok, MLP + 1}.
|
{ok, MLP + 1}.
|
||||||
|
|
||||||
handle_call({get, NumPages}, _From, MLP) ->
|
handle_call({get, NumPages}, _From, MLP) ->
|
||||||
|
|
Loading…
Reference in a new issue