Skip to content

Commit

Permalink
stdlib: export proc_lib:enter_loop_opt()
Browse files Browse the repository at this point in the history
  • Loading branch information
kikofernandez committed Jun 2, 2023
1 parent 9412c02 commit 81bd801
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/stdlib/doc/src/gen_server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ gen_server:abcast -----> Module:handle_cast/2
<seemfa marker="#start_link/3"><c>start_link/3,4</c></seemfa>.
</p>
<taglist>
<tag><c>{hibernate_after,<anno>HibernateAfterTimeout</anno>}</c></tag>
<tag><c>{hibernate_after,HibernateAfterTimeout}</c></tag>
<item>
<p>
Specifies that the <c>gen_server</c> process awaits
Expand All @@ -309,10 +309,10 @@ gen_server:abcast -----> Module:handle_cast/2
<c>proc_lib:hibernate/3</c></seemfa>).
</p>
</item>
<tag><c>{debug,<anno>Dbgs</anno>}</c></tag>
<tag><c>{debug,Dbgs}</c></tag>
<item>
<p>
For every entry in <c><anno>Dbgs</anno></c>,
For every entry in <c>Dbgs</c>,
the corresponding function in
<seeerl marker="sys"><c>sys(3)</c></seeerl> is called.
</p>
Expand Down
2 changes: 1 addition & 1 deletion lib/stdlib/doc/src/gen_statem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ handle_event(_, _, State, Data) ->
<tag><c>debug</c></tag>
<item>
<p>
For every entry in <c><anno>Dbgs</anno></c>,
For every entry in <c>Dbgs</c>,
the corresponding function in
<seeerl marker="sys"><c>sys</c></seeerl> is called.
</p>
Expand Down
4 changes: 1 addition & 3 deletions lib/stdlib/src/gen_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@
proc_lib:option() | enter_loop_opt().
%%
% Some gen:option()s works for enter_loop/*
-type enter_loop_opt() ::
{'hibernate_after', HibernateAfterTimeout :: timeout()}
| {'debug', Dbgs :: [sys:debug_option()]}.
-type enter_loop_opt() :: proc_lib:enter_loop_opt().

-type start_ret() :: % gen:start_ret() without monitor return
{'ok', Pid :: pid()}
Expand Down
5 changes: 2 additions & 3 deletions lib/stdlib/src/gen_statem.erl
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,8 @@ event_type(Type) ->
% What gen:call/3,4 and gen:stop/1,3 accepts
-type server_ref() :: proc_lib:sup_ref().

-type enter_loop_opt() :: % Some gen:option()s works for enter_loop/*
{'hibernate_after', HibernateAfterTimeout :: timeout()}
| {'debug', Dbgs :: [sys:debug_option()]}.
% Some gen:option()s works for enter_loop/*
-type enter_loop_opt() :: proc_lib:enter_loop_opt().

-type start_opt() :: proc_lib:option() | enter_loop_opt().

Expand Down
8 changes: 5 additions & 3 deletions lib/stdlib/src/proc_lib.erl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
-export_type([spawn_option/0]).
-export_type([start_spawn_option/0]).

-export_type([sup_name/0, sup_ref/0, option/0, debug/0]).
-export_type([sup_name/0, sup_ref/0, option/0, debug/0, enter_loop_opt/0]).

-include("logger.hrl").

Expand Down Expand Up @@ -98,8 +98,10 @@

-type option() :: {'timeout', Timeout :: timeout()}
| {'debug', Dbgs :: [debug()]}
| {'spawn_opt', SpawnOptions :: [start_spawn_option()]}
| {'hibernate_after', HibernateAfterTimeout :: timeout()}.
| enter_loop_opt().

-type enter_loop_opt() :: {'hibernate_after', HibernateAfterTimeout :: timeout()}
| {'debug', Dbgs :: [sys:debug_option()]}.


-type debug () :: 'trace' | 'log' | 'statistics' | 'debug'
Expand Down

0 comments on commit 81bd801

Please sign in to comment.