Skip to content
Browse files

modified: src/joy_thread.erl

  • Loading branch information...
1 parent da55481 commit 5a6397aeb0a6aa7b4f720c4eec14c43a2f93e26b @wsl919 committed Apr 24, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/joy_thread.erl
View
14 src/joy_thread.erl
@@ -43,12 +43,14 @@ init(ThreadID, ThreadMod, PoolPid, ThreadInitParams) ->
loop(State = #joy_thread_state{context = Context, mod = Mod}) ->
receive
{run, Data} ->
- {ok, NewContext} = Mod:run(Context, Data),
- % case catch Mod:run(Data) of
- % Msg ->
- % joy_log:error("thread error:~p~n", [Msg])
- % end,
- loop(State#joy_thread_state{context = NewContext});
+ %{ok, NewContext} = Mod:run(Context, Data),
+ case catch Mod:run(Context, Data) of
+ {ok, NewContext} ->
+ loop(State#joy_thread_state{context = NewContext});
+ Msg ->
+ joy_log:error("thread error:~p~n", [Msg]),
+ loop(State)
+ end;
Msg ->
joy_log:warning("[joy_thread]unknown msg:~p~n", [Msg]),

0 comments on commit 5a6397a

Please sign in to comment.
Something went wrong with that request. Please try again.