Donny Viszneki <smirk thebuicksix.com> writes:
Sometimes you seem to be saying that your code WORKS on Linux, and in
some places you seem to imply that you haven’t tried it on Linux.
Perhaps this is just me being stupid, but which is it?
Sorry,
My app, inited with EVENTTHREAD, works on Linux.
My app, inited with EVENTTHREAD, crashes on Mac.
My app, inited without EVENTTHREAD, doesn’t work on Mac (look previous
posts).
My app, inited without EVENTTHREAD, I haven’t tested on Linux.
I read SDL-sources yesterday, and found that EVENTTHREAD is on the
TODO/wishlist
for win32 and Mac. So that solves that…
That refers to classic MacOS.
I never though about EVENTHREAD on OS X, to be frank I wasn’t even
aware it existed :-). But I am not at all surprised that it doesn’t
work out of the box. To quote the docs:
“To use Cocoa from multiple threads, the Cocoa framework must be put
into multithreading mode, which activates greater thread safety
measures. This happens automatically when the first NSThread is
detached. If you use the POSIX thread APIs to create threads, your
application must detach at least one NSThread, which may immediately
exit, before any pthreads can use Cocoa.”
Even with that, i am not sure it’ll be enough. But I’ll try and see if
I can come up with a patch to fix the problem.
But. Does threads work on MacOSX? runnig the testthread program that
came with
SDL-1.2.7 suggests that they don’t. Are they supposed to?
(the testthread program spits out something like:
Killing thread 2
Thread 2 is alive
Thread 2 is alive
Thread 2 is alive
…
That’s a known issue with pthread_cancle / pthread_kill on Mac OS X
(the code didn’t work in 10.0; it did work in, I think 10.2; and it’s
not working anymore in 10.3; or something like that ;-). So most of the
thread code should work fine, just killing threads won’t. Not that
terribly hard to work around in most cases, though, just let your
thread finish by itself (i.e. if you thread function basically is an
endless loop, just change it to
while (!thisThreadShouldFinish) {
…
}
If you want to stop the thread, set “thisThreadShouldFinish” to true in
your main thread.
)
Or is it just me that cannot code
Bye,
MaxAm 20.07.2004 um 09:08 schrieb Kalle: