aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-02-21 13:24:08 +0100
committerBjörn Gustavsson <[email protected]>2013-05-31 14:52:13 +0200
commitde80abaac0af1ee62b69a405a5a36ecd601fab7c (patch)
tree6a52ee599f53f19ad80141befa7f265dccf17721 /lib
parent8e740bf11519cc7281d52be1325b1ac119daa926 (diff)
downloadotp-de80abaac0af1ee62b69a405a5a36ecd601fab7c.tar.gz
otp-de80abaac0af1ee62b69a405a5a36ecd601fab7c.tar.bz2
otp-de80abaac0af1ee62b69a405a5a36ecd601fab7c.zip
asn1ct_name: Make new/1 asynchronous
Since new/1 does not return any useful value and cannot fail, there is no reason to wait for a response from the name server process.
Diffstat (limited to 'lib')
-rw-r--r--lib/asn1/src/asn1ct_name.erl10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl
index 66d2bb9540..9711ea6d31 100644
--- a/lib/asn1/src/asn1ct_name.erl
+++ b/lib/asn1/src/asn1ct_name.erl
@@ -53,8 +53,7 @@ name_server_loop({Ref, Parent} = Monitor,Vars) ->
{From,{current,Variable}} ->
From ! {?MODULE,get_curr(Vars,Variable)},
name_server_loop(Monitor,Vars);
- {From,{new,Variable}} ->
- From ! {?MODULE,done},
+ {_From,{new,Variable}} ->
name_server_loop(Monitor,new_var(Vars,Variable));
{From,{prev,Variable}} ->
From ! {?MODULE,get_prev(Vars,Variable)},
@@ -85,9 +84,14 @@ req(Req) ->
error({name_server_died,Reason})
end.
+cast(Req) ->
+ get(?MODULE) ! {self(), Req},
+ ok.
+
clear() -> stop(), start().
curr(V) -> req({current,V}).
-new(V) -> req({new,V}).
+new(V) -> cast({new,V}).
+
prev(V) ->
case req({prev,V}) of
none ->