diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-23 13:10:21 +0000 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-03-23 13:10:21 +0000 |
commit | f4c016a93f7bebbd1bafe4d28209f9725c2731cb (patch) | |
tree | 9d9141f858c8b167264ab886119df7aa44ee0063 /src/pmon.erl | |
parent | 623e8f808f8b89b59a6a577a57bf0d5e91e4b569 (diff) | |
download | rabbitmq-server-f4c016a93f7bebbd1bafe4d28209f9725c2731cb.tar.gz |
use pmon in mirror_queue_slave
Diffstat (limited to 'src/pmon.erl')
-rw-r--r-- | src/pmon.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pmon.erl b/src/pmon.erl index 45786577..171386a0 100644 --- a/src/pmon.erl +++ b/src/pmon.erl @@ -17,7 +17,7 @@ -module(pmon). -export([new/0, monitor/2, monitor_all/2, demonitor/2, is_monitored/2, erase/2, - monitored/1, is_empty/1]). + monitored/1, to_list/1, is_empty/1]). -ifdef(use_specs). @@ -34,6 +34,7 @@ -spec(is_monitored/2 :: (pid(), ?MODULE()) -> boolean()). -spec(erase/2 :: (pid(), ?MODULE()) -> ?MODULE()). -spec(monitored/1 :: (?MODULE()) -> [pid()]). +-spec(to_list/1 :: (?MODULE()) -> [{pid(), reference()}]). -spec(is_empty/1 :: (?MODULE()) -> boolean()). -endif. @@ -61,4 +62,6 @@ erase(Pid, M) -> dict:erase(Pid, M). monitored(M) -> dict:fetch_keys(M). +to_list(M) -> dict:to_list(M). + is_empty(M) -> dict:size(M) == 0. |