END block ignored while run_cmd() is executing

Marc Lehmann schmorp at schmorp.de
Thu Apr 12 09:29:07 CEST 2012

On Mon, Apr 09, 2012 at 11:14:07AM -0400, Fulko Hew <fulko.hew at gmail.com> wrote:
> it seems that while run_cmd() is executing... if I
> (for example) send it a INT signal, the INT signal is
> caught, but the END block doesn't get executed.  If I
> wait for the run_cmd() to finish and then press CTL C,
> the END block _is_ executed.

Hmm, looking at your example again, you are blocking in an event loop
callback, which means anything can happen (including memory corruption,
depending on the loop in use).

Do you still get the behaviour if you don't use a blocking wait in
obtainer? Or put it into a Coro async?

Also, at least debians version of Coro is from 2009 (ubuntu probably too),
which is just, uhm, 16 releases behind. if you call exit in another thread
then END blocks might not run (as documented in those versions).

                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\

More information about the anyevent mailing list