Martin Sebor wrote:
Farid Zaripov wrote:
[...]
In the test below correct output does the first thread only (prints
"str1") and
this result depends from OS, CPU power etc.
Okay, that's because the thr_arg array goes out of scope after
run_test returns. I agree that the thread should be able to safely
access the argument in this case. But I don't think the problem is
limited to the thread argument; it affects the thread id as well
(the address of the thread id is passed to the thread function when
the argument array is null). Let me look into changing it as well.
On second thought, I don't think we want to change the thread
id case. So I'll apply your originally proposed patch.
Martin