[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LuaLanes on Ubuntu 11.10, kernel 3.0
- From: Benoit Germain <bnt.germain@...>
- Date: Thu, 10 Nov 2011 12:04:56 +0100
2011/11/10 Philipp Janda <siffiejoe@gmx.net>:
>
> A proper solution would probably involve using pthread_cleanup_push to free
> the Lane's memory on actual cancellation.
I am not sure I get the usage of pthread_cancel_push right. What I
could do is this:
Add a pthread_cancel_push()/pthread_cancel_pop() pair at the beginning
and end of lane_main.
The callback I provide sets some flag in the s_lane structure.
In selfdestruct_atexit(), after the call to THREAD_KILL(), I
block-wait for this flag to be set in the structure, at which point I
can free it.
Would it be ok that way? When the thread actually terminates because
of the thread_kill() call, am I supposed to call pthread_cancel_pop()
(which I suppose might not be the case if execution doesn't reach the
end of lane_main)?
--
Benoit.
- References:
- LuaLanes on Ubuntu 11.10, kernel 3.0, Thijs Koerselman
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Benoit Germain
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Hisham
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Thijs Koerselman
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Benoit Germain
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Thijs Koerselman
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Taj Khattra
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Benoit Germain
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Philipp Janda
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Benoit Germain
- Re: LuaLanes on Ubuntu 11.10, kernel 3.0, Philipp Janda