[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSThread test failing
From: |
David Chisnall |
Subject: |
Re: NSThread test failing |
Date: |
Mon, 12 Aug 2013 10:37:59 +0100 |
On 12 Aug 2013, at 10:33, Wolfgang Lux <address@hidden> wrote:
> I doubt that your analysis is correct. Sleep is a function call and
> backgroundTid is a global variable. The compiler cannot (and must not) assume
> that backgroundTid is not changed during the call to sleep.
That depends on your standard library headers. Sleep() may be marked as not
modifying any global state, in which case the compiler is free to make that
transformation. It is also a library function with known semantics and so an
infinite loop containing sleep() may be transformed into undefined behaviour.
David
-- Sent from my Difference Engine