aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_name.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-02-21 13:21:01 +0100
committerBjörn Gustavsson <[email protected]>2013-05-31 14:52:12 +0200
commit8e740bf11519cc7281d52be1325b1ac119daa926 (patch)
tree6f61ba25df8e60aad78139db32c9ddd1c510bc2f /lib/asn1/src/asn1ct_name.erl
parenteba8580fe10c483cab3a2dc4c603ac27b3ffb4f6 (diff)
downloadotp-8e740bf11519cc7281d52be1325b1ac119daa926.tar.gz
otp-8e740bf11519cc7281d52be1325b1ac119daa926.tar.bz2
otp-8e740bf11519cc7281d52be1325b1ac119daa926.zip
asn1ct_name: Use a monitor instead of an arbitrary timeout
Diffstat (limited to 'lib/asn1/src/asn1ct_name.erl')
-rw-r--r--lib/asn1/src/asn1ct_name.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl
index 617bea759a..66d2bb9540 100644
--- a/lib/asn1/src/asn1ct_name.erl
+++ b/lib/asn1/src/asn1ct_name.erl
@@ -75,11 +75,14 @@ active(V) ->
end.
req(Req) ->
- get(?MODULE) ! {self(), Req},
+ Pid = get(?MODULE),
+ Ref = monitor(process, Pid),
+ Pid ! {self(), Req},
receive
- {?MODULE, Reply} -> Reply
- after 5000 ->
- exit(name_server_timeout)
+ {?MODULE, Reply} ->
+ Reply;
+ {'DOWN', Ref, process, Pid, Reason} ->
+ error({name_server_died,Reason})
end.
clear() -> stop(), start().