lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, Dec 30, 2013 at 5:44 PM, Finn Wilcox <finnw@finnw.me.uk> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 30/12/2013 22:38, Rena wrote:
> //we can no longer unlock this->mutex_refcount, so the other thread
> is //going to block forever or segfault
No it is not, because it does not have a reference to the object
(otherwise refcount would not be 0.)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSwfdQAAoJEHp3pOlF38H/a8MH/33wb1uMB5ymSZCG2mZRrym2
7PI50hCm8e7OP4G/cy0ZCKQFCR9wRCy98vBLKfnYESpeCx8YtL2Ca+lIclgaJJ8q
XmPOWS6pu6EGjtDQdje6q4kUyagziZglGE4ZnebYU2vra+h82Fk04IipdvCRaGSX
b8okMv0bvyBUZLhJ039hKTcc0f+oUhGEcG8NoOp5ztoRV515zwLDiTSlslPwGkXv
6GC7eA4KmcwxEBAefJujDJvaAan6jUavkavdLJNp7PM0qHzzpd/wGbILCupxeDce
mpl4Lkas5u9OUDPDQz7wrniO73PpHSCkXBzc5LeBZzf3nq+AhJ8Cl1mtu9BmVTM=
=xuR7
-----END PGP SIGNATURE-----


Of course...

It still seems like there's an issue though. If I let the child threads keep running after the main thread exits, they don't shut down correctly. I have extensive debug output logging what each thread is doing, and after the main thread's destructor fires, some child threads just stop abruptly (sometimes in the middle of writing a line). If I don't explicitly load my module in each child thread, then they'll even segfault. (Maybe trying to access some code in that module after it's been unloaded?) Is there something else I have to do to allow child threads to keep running after the main thread finishes?


--
Sent from my Game Boy.