-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/18/2014 03:05 AM, David Davidović wrote:
> Sorry if this a stupid question and shows my failure of grasping
> the basic concepts but I feel completely lost. So I have a watchdog
> timer whose job is to check every 30 seconds if there is a global
> kill switch flag set for the daemon, and if there is, it calls
> uv_stop() on the loop. (I understand I could just exit() from there
> but I like to keep valgrind happy at the end of program execution
> while debugging.) uv_run() returns after that, but when I try
> calling uv_loop_close() it returns UV_BUSY, and subsequent calls to
> uv_loop_delete() try the same and bomb with a SIGABRT because of an
> assertion failure. I'm not sure as to how this could happen,
> shouldn't uv_run() returning imply that the loop is done processing
> all of its data? Maybe if libuv runs its own threadpool somewhere,
> is there any way I can join on these threads as they could be the
> cause of the problem? How should I safely and successfully
> terminate the loop in such a condition?
> 

See Fedor's response. Here is some code you could adapt to your needs:
https://github.com/joyent/libuv/blob/master/test/task.h#L221-L231


Cheers,

- -- 
Saúl Ibarra Corretgé
bettercallsaghul.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQIcBAEBAgAGBQJTKAENAAoJEEEOVVOum8BZrF0P/2KbYYQ/P62HvyZY7Ymy7YuE
DB5va6ixBx0nlzNNk6INsrQf3i7dXNvsiBdMQYdde3f/cDpZxcB9rHGdsZhb89Vb
3HDcpXPEu9GvRU46MX4ntiBmS2eWQnA9QBV5pDGtNOj2gX9kjXavM9VHTXJk2HPq
2AHuItq9fBCBm5lPg1JOpf2toMjduS4EH2Lj8gObTMjamDQuTlYToCNTdRHZrgxL
K+XaI+uE0PwUylGqd1UHY08dyT7/jf/+2gEShkSnQgmSaSWbPHGw0qwsdEVHVoWT
Qwrwe9Hd6U2qjiEkBRcFuB83JkbMZ/160UxZT5/ByEiojaNayvdOIQhFPJi//NBO
Xek36r4nRnrkKPNz0idqN//uNr8JDGpJ5Lx1aELs3hew69ocOTvqZbpJs7r8e6mV
rH93OQU7I2CgsGVXFZ7zCV1StvsfWUt2laVyZ0IzQeIRDnjU1Vx8jpOBtMKeBhcE
VibWf8uB74mRNb7zTDSfVOA3ABQOHb9/XMCIu5+WVuMhdDiB1Cjl2aUmV23KtXOU
3MogROwuRLRyjAL+u9yEIaBgrjSOFEEJdK03g82fP50nF294eLOe/hgclq2QKJ6P
Z46QFZut2WxRvltU0jJDcfl0dugTx6j6g2yJJykj0LB+gojTAIWfLDsu9ckDAWSE
t/EPcMNK+Po6w7hnBs5U
=C1Fu
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to