diff options
author | Ricardo Catalinas Jiménez <[email protected]> | 2012-02-24 14:47:41 +0100 |
---|---|---|
committer | Ricardo Catalinas Jiménez <[email protected]> | 2012-02-24 14:47:41 +0100 |
commit | 005fd391b1a212b09f45ee9900441014ec19c1a4 (patch) | |
tree | 8c1e272fb43c30b8ec0633fbf66116a10aaf2e07 | |
parent | c165d6c76fd99a0b3d91677b4531d9ee00c97dae (diff) | |
download | otp-005fd391b1a212b09f45ee9900441014ec19c1a4.tar.gz otp-005fd391b1a212b09f45ee9900441014ec19c1a4.tar.bz2 otp-005fd391b1a212b09f45ee9900441014ec19c1a4.zip |
Fix supervisor doc: Shutdown, MaxR and MaxT type specs
The next code snippets from supervisor.erl show that Shutdown from a
child specification must be greater than zero and the same applies to
MaxT.
--- supervisor.erl ----------------------------------------------------------
validShutdown(Shutdown, _)
when is_integer(Shutdown), Shutdown > 0 -> true;
validShutdown(infinity, _) -> true;
validShutdown(brutal_kill, _) -> true;
validShutdown(Shutdown, _) -> throw({invalid_shutdown, Shutdown}).
validIntensity(Max) when is_integer(Max),
Max >= 0 -> true;
validIntensity(What) -> throw({invalid_intensity, What}).
validPeriod(Period) when is_integer(Period),
Period > 0 -> true;
validPeriod(What) -> throw({invalid_period, What}).
-----------------------------------------------------------------------------
-rw-r--r-- | lib/stdlib/doc/src/supervisor.xml | 5 | ||||
-rw-r--r-- | system/doc/design_principles/sup_princ.xml | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/stdlib/doc/src/supervisor.xml b/lib/stdlib/doc/src/supervisor.xml index 33a7f5bb6a..ab360fbb6f 100644 --- a/lib/stdlib/doc/src/supervisor.xml +++ b/lib/stdlib/doc/src/supervisor.xml @@ -114,7 +114,7 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} M = F = atom() A = [term()] Restart = permanent | transient | temporary - Shutdown = brutal_kill | int()>=0 | infinity + Shutdown = brutal_kill | int()>0 | infinity Type = worker | supervisor Modules = [Module] | dynamic Module = atom()</pre> @@ -517,7 +517,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} <v>Args = term()</v> <v>Result = {ok,{{RestartStrategy,MaxR,MaxT},[ChildSpec]}} | ignore</v> <v> RestartStrategy = <seealso marker="#type-strategy">strategy()</seealso></v> - <v> MaxR = MaxT = integer()>=0</v> + <v> MaxR = integer()>=0</v> + <v> MaxT = integer()>0</v> <v> ChildSpec = <seealso marker="#type-child_spec">child_spec()</seealso></v> </type> <desc> diff --git a/system/doc/design_principles/sup_princ.xml b/system/doc/design_principles/sup_princ.xml index c473e257fa..353430752c 100644 --- a/system/doc/design_principles/sup_princ.xml +++ b/system/doc/design_principles/sup_princ.xml @@ -136,7 +136,7 @@ init(...) -> M = F = atom() A = [term()] Restart = permanent | transient | temporary - Shutdown = brutal_kill | integer()>=0 | infinity + Shutdown = brutal_kill | integer()>0 | infinity Type = worker | supervisor Modules = [Module] | dynamic Module = atom()]]></code> |