|
82 | 82 | spawn/3,
|
83 | 83 | spawn_link/1,
|
84 | 84 | spawn_link/3,
|
| 85 | + spawn_monitor/1, |
| 86 | + spawn_monitor/3, |
85 | 87 | spawn_opt/2,
|
86 | 88 | spawn_opt/4,
|
87 | 89 | link/1,
|
@@ -929,6 +931,29 @@ spawn_link(Function) ->
|
929 | 931 | spawn_link(Module, Function, Args) ->
|
930 | 932 | erlang:spawn_opt(Module, Function, Args, [link]).
|
931 | 933 |
|
| 934 | +%%----------------------------------------------------------------------------- |
| 935 | +%% @param Function function to create a process from |
| 936 | +%% @returns pid of the new process |
| 937 | +%% @doc Create a new process and monitor it. |
| 938 | +%% @end |
| 939 | +%%----------------------------------------------------------------------------- |
| 940 | +-spec spawn_monitor(Function :: function()) -> pid(). |
| 941 | +spawn_monitor(Function) -> |
| 942 | + erlang:spawn_opt(Function, [monitor]). |
| 943 | + |
| 944 | +%%----------------------------------------------------------------------------- |
| 945 | +%% @param Module module of the function to create a process from |
| 946 | +%% @param Function name of the function to create a process from |
| 947 | +%% @param Args arguments to pass to the function to create a process from |
| 948 | +%% @returns pid of the new process |
| 949 | +%% @doc Create a new process by calling exported Function from Module with Args |
| 950 | +%% and monitor it. |
| 951 | +%% @end |
| 952 | +%%----------------------------------------------------------------------------- |
| 953 | +-spec spawn_monitor(Module :: module(), Function :: atom(), Args :: [any()]) -> pid(). |
| 954 | +spawn_monitor(Module, Function, Args) -> |
| 955 | + erlang:spawn_opt(Module, Function, Args, [monitor]). |
| 956 | + |
932 | 957 | %%-----------------------------------------------------------------------------
|
933 | 958 | %% @param Function function to create a process from
|
934 | 959 | %% @param Options additional options.
|
|
0 commit comments