From 005fd391b1a212b09f45ee9900441014ec19c1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Catalinas=20Jim=C3=A9nez?= Date: Fri, 24 Feb 2012 14:47:41 +0100 Subject: 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}). ----------------------------------------------------------------------------- --- lib/stdlib/doc/src/supervisor.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/stdlib') 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() @@ -517,7 +517,8 @@ child_spec() = {Id,StartFunc,Restart,Shutdown,Type,Modules} Args = term() Result = {ok,{{RestartStrategy,MaxR,MaxT},[ChildSpec]}} | ignore  RestartStrategy = strategy() -  MaxR = MaxT = integer()>=0 +  MaxR = integer()>=0 +  MaxT = integer()>0  ChildSpec = child_spec() -- cgit v1.2.3