[C(++)] Strange problem with pthread
This program has been running perfectly in Tiger and Leopard up to 10.5.1. But now it behaves differently. When command B is executed with the "system()" call, it locks up until the thread with command A has finished. This makes the whole threading system useless because I could as well just execute the two commands sequentially.
I have stripped down the source code to the bare essentials. It can be downloaded at: http://preview.tinyurl.com/2zovrh
When executed (make sure to erase all "file*" files from previous runs first), you'll see that the main thread stops at "Doing something with file1", and doesn't start waiting for file3. It only continues when command A has finished even though the pthread_join() call has not yet been used. Why is this? I assume something has changed with pthread in 10.5.2. How do I fix this?
MacBook Pro C2D 2.33, Mac OS X (10.5.2)