aboutsummaryrefslogtreecommitdiffstats
path: root/lib/test_server/src/test_server_sup.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2012-03-22 18:46:41 +0100
committerPeter Andersson <[email protected]>2012-03-22 19:24:25 +0100
commit88c935d87a9878016e07b5a3f42bc8efe30b1eea (patch)
treea8d03b1e70f6d20deab0ee0ff0cc3ed1930c2ebf /lib/test_server/src/test_server_sup.erl
parentc2a3647e471bb08de24d867bc7c3f541e2f7a15d (diff)
downloadotp-88c935d87a9878016e07b5a3f42bc8efe30b1eea.tar.gz
otp-88c935d87a9878016e07b5a3f42bc8efe30b1eea.tar.bz2
otp-88c935d87a9878016e07b5a3f42bc8efe30b1eea.zip
Fix various problems with the user timetrap implementation
Diffstat (limited to 'lib/test_server/src/test_server_sup.erl')
-rw-r--r--lib/test_server/src/test_server_sup.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/test_server/src/test_server_sup.erl b/lib/test_server/src/test_server_sup.erl
index d85d1658c3..68d6198bb7 100644
--- a/lib/test_server/src/test_server_sup.erl
+++ b/lib/test_server/src/test_server_sup.erl
@@ -100,8 +100,12 @@ timetrap_cancel(Handle) ->
unlink(Handle),
MonRef = erlang:monitor(process, Handle),
exit(Handle, kill),
- receive {'DOWN',MonRef,_,_,_} -> ok after 2000 -> ok end.
-
+ receive {'DOWN',MonRef,_,_,_} -> ok
+ after
+ 2000 ->
+ erlang:demonitor(MonRef, [flush]),
+ ok
+ end.
capture_get(Msgs) ->
receive
@@ -111,7 +115,6 @@ capture_get(Msgs) ->
lists:reverse(Msgs)
end.
-
messages_get(Msgs) ->
receive
Msg ->
@@ -120,7 +123,6 @@ messages_get(Msgs) ->
lists:reverse(Msgs)
end.
-
timecall(M, F, A) ->
Befor = erlang:now(),
Val = apply(M, F, A),