From 63cea4f396cfd474e90e2ef7e3d5c19d3d9a9735 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Muska=C5=82a?= Date: Fri, 31 Mar 2017 01:47:08 +0200 Subject: [PATCH] Add information about after clause timeout limit (#5942) Source: http://erlang.org/doc/reference_manual/expressions.html#id80928 --- lib/elixir/lib/kernel/special_forms.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/elixir/lib/kernel/special_forms.ex b/lib/elixir/lib/kernel/special_forms.ex index 4c94785d04..18724807ed 100644 --- a/lib/elixir/lib/kernel/special_forms.ex +++ b/lib/elixir/lib/kernel/special_forms.ex @@ -1900,8 +1900,8 @@ defmodule Kernel.SpecialForms do end The `after` clause can be specified even if there are no match clauses. - The timeout value given to `after` can be a variable; two special - values are allowed: + The timeout value given to `after` can be any expression evaluating to + one of the allowed values: * `:infinity` - the process should wait indefinitely for a matching message, this is the same as not using a timeout @@ -1909,6 +1909,10 @@ defmodule Kernel.SpecialForms do * `0` - if there is no matching message in the mailbox, the timeout will occur immediately + * positive integer smaller than `4_294_967_295` (`0xFFFFFFFF` + in hex notation) - it should be possible to represent the timeout + value as an unsigned 32-bit integer. + ## Variables handling The `receive/1` special form handles variables exactly as the `case/2`