Skip to content

Commit

Permalink
Merge branch 'ks/erlang-spawn_opt-process_level/OTP-11008' into maint
Browse files Browse the repository at this point in the history
* ks/erlang-spawn_opt-process_level/OTP-11008:
  Fixed documentation for priority_level to spawn_opt
  Consistent definition of priority levels
  • Loading branch information
rimmius committed Apr 4, 2013
2 parents b8e7276 + ed0b56d commit d6a367d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
4 changes: 4 additions & 0 deletions erts/doc/src/erlang.xml
Expand Up @@ -4477,6 +4477,7 @@ true</pre>
</func> </func>
<func> <func>
<name name="spawn_opt" arity="2"/> <name name="spawn_opt" arity="2"/>
<type name="priority_level" />
<fsummary>Create a new process with a fun as entry point</fsummary> <fsummary>Create a new process with a fun as entry point</fsummary>
<desc> <desc>
<p>Returns the pid of a new process started by the application <p>Returns the pid of a new process started by the application
Expand All @@ -4490,6 +4491,7 @@ true</pre>
</func> </func>
<func> <func>
<name name="spawn_opt" arity="3"/> <name name="spawn_opt" arity="3"/>
<type name="priority_level" />
<fsummary>Create a new process with a fun as entry point on a given node</fsummary> <fsummary>Create a new process with a fun as entry point on a given node</fsummary>
<desc> <desc>
<p>Returns the pid of a new process started by the application <p>Returns the pid of a new process started by the application
Expand All @@ -4501,6 +4503,7 @@ true</pre>
</func> </func>
<func> <func>
<name name="spawn_opt" arity="4"/> <name name="spawn_opt" arity="4"/>
<type name="priority_level" />
<fsummary>Create a new process with a function as entry point</fsummary> <fsummary>Create a new process with a function as entry point</fsummary>
<desc> <desc>
<p>Works exactly like <p>Works exactly like
Expand Down Expand Up @@ -4602,6 +4605,7 @@ true</pre>
</func> </func>
<func> <func>
<name name="spawn_opt" arity="5"/> <name name="spawn_opt" arity="5"/>
<type name="priority_level" />
<fsummary>Create a new process with a function as entry point on a given node</fsummary> <fsummary>Create a new process with a function as entry point on a given node</fsummary>
<desc> <desc>
<p>Returns the pid of a new process started by the application <p>Returns the pid of a new process started by the application
Expand Down
30 changes: 15 additions & 15 deletions erts/preloaded/src/erlang.erl
Expand Up @@ -1905,11 +1905,11 @@ setelement(_Index, _Tuple1, _Value) ->
Function :: atom(), Function :: atom(),
Args :: [term()], Args :: [term()],
Options :: [Option], Options :: [Option],
Option :: link | monitor | {priority, Level} Option :: link | monitor
| {priority, Level :: priority_level()}
| {fullsweep_after, Number :: non_neg_integer()} | {fullsweep_after, Number :: non_neg_integer()}
| {min_heap_size, Size :: non_neg_integer()} | {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()}, | {min_bin_vheap_size, VSize :: non_neg_integer()}.
Level :: low | normal | high.
spawn_opt(_Tuple) -> spawn_opt(_Tuple) ->
erlang:nif_error(undefined). erlang:nif_error(undefined).


Expand Down Expand Up @@ -2244,11 +2244,11 @@ spawn_monitor(M, F, A) ->
-spec spawn_opt(Fun, Options) -> pid() | {pid(), reference()} when -spec spawn_opt(Fun, Options) -> pid() | {pid(), reference()} when
Fun :: function(), Fun :: function(),
Options :: [Option], Options :: [Option],
Option :: link | monitor | {priority, Level} Option :: link | monitor
| {priority, Level :: priority_level()}
| {fullsweep_after, Number :: non_neg_integer()} | {fullsweep_after, Number :: non_neg_integer()}
| {min_heap_size, Size :: non_neg_integer()} | {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()}, | {min_bin_vheap_size, VSize :: non_neg_integer()}.
Level :: low | normal | high.
spawn_opt(F, O) when erlang:is_function(F) -> spawn_opt(F, O) when erlang:is_function(F) ->
spawn_opt(erlang, apply, [F, []], O); spawn_opt(erlang, apply, [F, []], O);
spawn_opt({M,F}=MF, O) when erlang:is_atom(M), erlang:is_atom(F) -> spawn_opt({M,F}=MF, O) when erlang:is_atom(M), erlang:is_atom(F) ->
Expand All @@ -2262,11 +2262,11 @@ spawn_opt(F, O) ->
Node :: node(), Node :: node(),
Fun :: function(), Fun :: function(),
Options :: [Option], Options :: [Option],
Option :: link | monitor | {priority, Level} Option :: link | monitor
| {priority, Level :: priority_level()}
| {fullsweep_after, Number :: non_neg_integer()} | {fullsweep_after, Number :: non_neg_integer()}
| {min_heap_size, Size :: non_neg_integer()} | {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()}, | {min_bin_vheap_size, VSize :: non_neg_integer()}.
Level :: low | normal | high.
spawn_opt(N, F, O) when N =:= erlang:node() -> spawn_opt(N, F, O) when N =:= erlang:node() ->
spawn_opt(F, O); spawn_opt(F, O);
spawn_opt(N, F, O) when erlang:is_function(F) -> spawn_opt(N, F, O) when erlang:is_function(F) ->
Expand Down Expand Up @@ -2354,11 +2354,11 @@ spawn_link(N,M,F,A) ->
Function :: atom(), Function :: atom(),
Args :: [term()], Args :: [term()],
Options :: [Option], Options :: [Option],
Option :: link | monitor | {priority, Level} Option :: link | monitor
| {priority, Level :: priority_level()}
| {fullsweep_after, Number :: non_neg_integer()} | {fullsweep_after, Number :: non_neg_integer()}
| {min_heap_size, Size :: non_neg_integer()} | {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()}, | {min_bin_vheap_size, VSize :: non_neg_integer()}.
Level :: low | normal | high.
spawn_opt(M, F, A, Opts) -> spawn_opt(M, F, A, Opts) ->
case catch erlang:spawn_opt({M,F,A,Opts}) of case catch erlang:spawn_opt({M,F,A,Opts}) of
{'EXIT',{Reason,_}} -> {'EXIT',{Reason,_}} ->
Expand All @@ -2374,11 +2374,11 @@ spawn_opt(M, F, A, Opts) ->
Function :: atom(), Function :: atom(),
Args :: [term()], Args :: [term()],
Options :: [Option], Options :: [Option],
Option :: link | monitor | {priority, Level} Option :: link | monitor
| {priority, Level :: priority_level()}
| {fullsweep_after, Number :: non_neg_integer()} | {fullsweep_after, Number :: non_neg_integer()}
| {min_heap_size, Size :: non_neg_integer()} | {min_heap_size, Size :: non_neg_integer()}
| {min_bin_vheap_size, VSize :: non_neg_integer()}, | {min_bin_vheap_size, VSize :: non_neg_integer()}.
Level :: low | normal | high.
spawn_opt(N, M, F, A, O) when N =:= erlang:node(), spawn_opt(N, M, F, A, O) when N =:= erlang:node(),
erlang:is_atom(M), erlang:is_atom(F), erlang:is_atom(M), erlang:is_atom(F),
erlang:is_list(A), erlang:is_list(O) -> erlang:is_list(A), erlang:is_list(O) ->
Expand Down

0 comments on commit d6a367d

Please sign in to comment.