[erlang-questions] Re: erl startup

Wes James comptekki@REDACTED
Wed Jun 2 00:43:48 CEST 2010


On Tue, May 18, 2010 at 10:14 PM, Bernard Duggan <bernie@REDACTED> wrote:

<snip>

> start() ->
>        spawn_link(?MODULE, run, []).
>
> run() ->
>        Id_Table=ets:new(start_id_table, []),
>        io:format("~w~n",  [Id_Table]),
>        {ok, TRef}=timer:apply_interval(1000*60*5, prt, getc, []), % 1000
> milliseconds * 60 * 5 = 5 minutes
>        ets:insert(Id_Table, {id, TRef}),
>        wait_for_exit().
>
> wait_for_exit() ->
>        receive
>                some_exit_signal ->  ok;
>                _ ->  wait_for_exit()
>        end.
>

If I do this

 module:wait_for_exit() ! some_exit_signal.

It just hangs.  I have to hit ctrl-c to kill it.  Isn't it supposed to
exit wait_for_exit() after that?

thx,

-wes


More information about the erlang-questions mailing list