Selective receive requires that the ref is created in the scope of the receive.
This commit is contained in:
parent
e9f9d13e47
commit
45037cbcca
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,8 @@
|
|||
%% -------------------------------------------------------------------
|
||||
|
||||
-spec async_nif_enqueue(reference(), function(), [term()]) -> term() | {error, term()}.
|
||||
async_nif_enqueue(R, F, A) ->
|
||||
async_nif_enqueue(F, A) ->
|
||||
R = erlang:make_ref(),
|
||||
case erlang:apply(F, [R|A]) of
|
||||
{ok, enqueued} ->
|
||||
receive
|
||||
|
@ -44,4 +45,4 @@ async_nif_enqueue(R, F, A) ->
|
|||
Other
|
||||
end.
|
||||
|
||||
-define(ASYNC_NIF_CALL(Fun, Args), async_nif_enqueue(erlang:make_ref(), Fun, Args)).
|
||||
-define(ASYNC_NIF_CALL(Fun, Args), async_nif_enqueue(Fun, Args)).
|
||||
|
|
Loading…
Reference in a new issue