aboutsummaryrefslogtreecommitdiffstats
path: root/lib/megaco/src/engine/megaco_monitor.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2010-06-02 23:37:26 +0000
committerErlang/OTP <[email protected]>2010-06-02 23:37:26 +0000
commitbcb19b624d02a35c463fa7a84ed4e79eaa8eb278 (patch)
tree87176eb3c20666eca2827be4e6be8e45369f9674 /lib/megaco/src/engine/megaco_monitor.erl
parent16d2e129ff59db4917b0495d914df646f62669b9 (diff)
downloadotp-bcb19b624d02a35c463fa7a84ed4e79eaa8eb278.tar.gz
otp-bcb19b624d02a35c463fa7a84ed4e79eaa8eb278.tar.bz2
otp-bcb19b624d02a35c463fa7a84ed4e79eaa8eb278.zip
OTP-8529: Raise condition processing replies
Diffstat (limited to 'lib/megaco/src/engine/megaco_monitor.erl')
-rw-r--r--lib/megaco/src/engine/megaco_monitor.erl33
1 files changed, 28 insertions, 5 deletions
diff --git a/lib/megaco/src/engine/megaco_monitor.erl b/lib/megaco/src/engine/megaco_monitor.erl
index f95a20cf58..29275371be 100644
--- a/lib/megaco/src/engine/megaco_monitor.erl
+++ b/lib/megaco/src/engine/megaco_monitor.erl
@@ -1,19 +1,19 @@
%%
%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
-%%
+%%
+%% Copyright Ericsson AB 2000-2010. All Rights Reserved.
+%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved online at http://www.erlang.org/.
-%%
+%%
%% Software distributed under the License is distributed on an "AS IS"
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
%% the License for the specific language governing rights and limitations
%% under the License.
-%%
+%%
%% %CopyrightEnd%
%%
@@ -51,6 +51,11 @@
update_request_field/3, update_request_fields/2,
delete_request/1,
+ request_lockcnt_cre/1,
+ request_lockcnt_del/1,
+ request_lockcnt_inc/1,
+ request_lockcnt_dec/1,
+
lookup_reply/1,
lookup_reply_field/2,
match_replies/1,
@@ -115,6 +120,24 @@ update_request_fields(Key, NewFields) when is_list(NewFields) ->
delete_request(Key) ->
ets:delete(megaco_requests, Key).
+
+request_lockcnt_cre(TransId) ->
+ Key = {TransId, lockcnt},
+ ets:insert_new(megaco_requests, {Key, 1}).
+
+request_lockcnt_del(TransId) ->
+ Key = {TransId, lockcnt},
+ ets:delete(megaco_requests, Key).
+
+request_lockcnt_inc(TransId) ->
+ Key = {TransId, lockcnt},
+ (catch ets:update_counter(megaco_requests, Key, 1)).
+
+request_lockcnt_dec(TransId) ->
+ Key = {TransId, lockcnt},
+ (catch ets:update_counter(megaco_requests, Key, -1)).
+
+
lookup_reply(Key) ->
ets:lookup(megaco_replies, Key).