aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-06-10 09:47:24 +0200
committerLukas Larsson <[email protected]>2016-06-10 09:47:24 +0200
commit7979f72ce15ec5eeb8e0e9cfc1c291f10c4f0432 (patch)
tree582f90aac92b208b3fbf20c2f50bb588e28a6f53 /erts/preloaded
parent77e69343b8bf6de63242cbcea7ebb35be3bb99e9 (diff)
parent3ee5343415d6ae0ce1ff1c2a2555051431a9315e (diff)
downloadotp-7979f72ce15ec5eeb8e0e9cfc1c291f10c4f0432.tar.gz
otp-7979f72ce15ec5eeb8e0e9cfc1c291f10c4f0432.tar.bz2
otp-7979f72ce15ec5eeb8e0e9cfc1c291f10c4f0432.zip
Merge branch 'kvakvs/erts/monitor_port/OTP-11384'
* kvakvs/erts/monitor_port/OTP-11384: erts: Add port monitors
Diffstat (limited to 'erts/preloaded')
-rw-r--r--erts/preloaded/src/erlang.erl19
1 files changed, 12 insertions, 7 deletions
diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl
index 94f3078173..edf79b8f75 100644
--- a/erts/preloaded/src/erlang.erl
+++ b/erts/preloaded/src/erlang.erl
@@ -1206,16 +1206,18 @@ module_loaded(_Module) ->
erlang:nif_error(undefined).
-type registered_name() :: atom().
-
-type registered_process_identifier() :: registered_name() | {registered_name(), node()}.
-
-type monitor_process_identifier() :: pid() | registered_process_identifier().
+-type monitor_port_identifier() :: port() | registered_name().
%% monitor/2
--spec monitor(process, monitor_process_identifier()) -> MonitorRef when
- MonitorRef :: reference();
- (time_offset, clock_service) -> MonitorRef when
- MonitorRef :: reference().
+-spec monitor
+ (process, monitor_process_identifier()) -> MonitorRef
+ when MonitorRef :: reference();
+ (port, monitor_port_identifier()) -> MonitorRef
+ when MonitorRef :: reference();
+ (time_offset, clock_service) -> MonitorRef
+ when MonitorRef :: reference().
monitor(_Type, _Item) ->
erlang:nif_error(undefined).
@@ -2160,7 +2162,7 @@ process_flag(_Flag, _Value) ->
{max_heap_size, MaxHeapSize :: max_heap_size()} |
{monitored_by, Pids :: [pid()]} |
{monitors,
- Monitors :: [{process, Pid :: pid() |
+ Monitors :: [{process | port, Pid :: pid() | port() |
{RegName :: atom(), Node :: node()}}]} |
{message_queue_data, MQD :: message_queue_data()} |
{priority, Level :: priority_level()} |
@@ -3087,6 +3089,9 @@ port_info(Port) ->
(Port, monitors) -> {monitors, Monitors} | 'undefined' when
Port :: port() | atom(),
Monitors :: [{process, pid()}];
+ (Port, monitored_by) -> {monitored_by, MonitoredBy} | 'undefined' when
+ Port :: port() | atom(),
+ MonitoredBy :: [pid()];
(Port, name) -> {name, Name} | 'undefined' when
Port :: port() | atom(),
Name :: string();