simple proc_lib test example

Chandru chandrashekhar.mullaparthi@REDACTED
Wed Jul 26 12:27:04 CEST 2006


Hi,

On 26/07/06, jm <jeffm@REDACTED> wrote:
>
> Having some problems with the following program is simplified example
> based on something I'm trying to write,
>
> -module(test_proc).
>
> -export([go/0]).
>
> go() ->
>    proc_lib:start_link(?MODULE, simple, [], infinity).
>
> simple() ->
>    proc_lib:init_ack({ok, self()}),
>    await().
>
> await() ->
>    receive
>      after 1000 ->
>        exit({ok, timeout})
>     end.
>
>
> $ erlc test_proc.erl
> ./test_proc.erl:21: Warning: function await/0 is unused
> ./test_proc.erl:21: Warning: function simple/0 is unused


You have to export the simple/0 function for your proc_lib:start_link to
work. Once you export that, these warnings will disappear and your example
will work.

Chandru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060726/2963f8cd/attachment.htm>


More information about the erlang-questions mailing list