On 12 Aug 2013, at 03:44, Doug Warren <[email protected]> wrote:
> backgroundTid = 0;
> [backThread performSelectorInBackground:@selector(run:)
> withObject:backThread];
> while(backgroundTid == 0)
> sleep(1);
>
I don't know if this is your issue, however your test relies on undefined
behaviour. In C99, backgroundTid is not volatile and so the compiler is
entirely free to turn this into the equivalent of :
if (backgroundTid == 0)
while (1) { sleep(1); }
I would expect this program never to terminate. In C11, there is no
happens-before relationship between the store and the load and so the same is
allowed to happen but some other constraints are also in place.
David
-- Sent from my PDP-11
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev