diff options
author | Björn Gustavsson <[email protected]> | 2013-02-21 13:24:08 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-05-31 14:52:13 +0200 |
commit | de80abaac0af1ee62b69a405a5a36ecd601fab7c (patch) | |
tree | 6a52ee599f53f19ad80141befa7f265dccf17721 /lib/asn1/src | |
parent | 8e740bf11519cc7281d52be1325b1ac119daa926 (diff) | |
download | otp-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/asn1/src')
-rw-r--r-- | lib/asn1/src/asn1ct_name.erl | 10 |
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 -> |