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