Wait on close of penciller clerk

The clerk never calls the Penciller, so cannot deadlock.  Will wait for
a merge to be complete
This commit is contained in:
martinsumner 2017-01-14 22:59:04 +00:00
parent 0c01a90f96
commit 9577d24be0

View file

@ -62,7 +62,7 @@ clerk_prompt(Pid) ->
gen_server:cast(Pid, prompt).
clerk_close(Pid) ->
gen_server:cast(Pid, close).
gen_server:call(Pid, close, 20000).
%%%============================================================================
%%% gen_server callbacks
@ -72,12 +72,13 @@ init([]) ->
{ok, #state{}}.
handle_call({load, Owner, RootPath}, _From, State) ->
{reply, ok, State#state{owner=Owner, root_path=RootPath}, ?MIN_TIMEOUT}.
{reply, ok, State#state{owner=Owner, root_path=RootPath}, ?MIN_TIMEOUT};
handle_call(close, _From, State) ->
{stop, normal, ok, State}.
handle_cast(prompt, State) ->
handle_info(timeout, State);
handle_cast(close, State) ->
{stop, normal, State}.
handle_info(timeout, State).
handle_info(timeout, State) ->
case requestandhandle_work(State) of
@ -89,7 +90,6 @@ handle_info(timeout, State) ->
{noreply, State, ?MIN_TIMEOUT}
end.
terminate(Reason, _State) ->
leveled_log:log("PC005", [self(), Reason]).