Re: [Valgrind-users] Helgrind data race question

2013-05-22 Thread Phil Longstaff
e the easiest way out." -Original Message- From: David Faure [mailto:fa...@kde.org] Sent: Thursday, May 16, 2013 2:34 PM To: valgrind-users@lists.sourceforge.net Cc: Phil Longstaff Subject: Re: [Valgrind-users] Helgrind data race question On Tuesday 14 May 2013 20:18:44 Phil Longs

Re: [Valgrind-users] Helgrind data race question

2013-05-16 Thread David Faure
On Tuesday 14 May 2013 20:18:44 Phil Longstaff wrote: > int* my_ptr = new int; > *my_ptr = 10; > pthread_mutex_lock(&lock); > shared_ptr = my_ptr; > pthread_mutex_unlock(&lock); > > Thread 2: > pthread_mutex_lock(&lock); > int* my_ptr = shared_ptr; > pthread_mutex_unlock(&lock); > ... = *my_ptr;