|
From: Mike F. <va...@ge...> - 2007-12-04 04:47:14
|
On Monday 03 December 2007, Patrick Kirsch wrote: > I have a question on testcase pthread_create/1-1.c : > there is shared variable "int *ctrl =3D (int *) arg;" in function > "hp_func" which should be protected through pthread_mutex or similar, > right? As I understand this shared variable should always be protected? > So is there a reason why there are no pthread synchronisation calls? > > As you can see in the suggested temporary patch below, is it possible to > add volatile-statement to the shared variables? > > I'm asking, because sometimes this testcase fails on s390x. perhaps look at the generated assembly code and see if gcc is incorrectly=20 optimizing away memory loads ? adding volatile sounds like you're ignoring= a=20 deeper problem ... =2Dmike |