[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaTask needs your help
- From: Thomas Lauer <thomas.lauer@...>
- Date: Mon, 09 Jul 2007 11:42:20 +0100
David Given <email@example.com> wrote:
> > I am not sure that this line is indeed a problem. Isn't checking an int
> > an atomic operation? As aTask is declared volatile, it should be
> > re-referenced, so a change during the loop would not be a problem
> > either.
> Ah, but that's not an atomic operation. That line compiles into something like:
You're right, of course. I was fixed on the comparison (which may indeed
be atomic) but the surrounding pointer arithmetic clearly isn't. I'll
have some more fun with fiddling the mutex then.
> Hilarity ensues.
web : http://thomaslauer.com/start