|
From: Philippe W. <phi...@sk...> - 2013-09-27 17:35:45
|
On Fri, 2013-09-27 at 15:01 +0000, Phil Longstaff wrote: > I was thinking about this one last night, and it's trickier than I first thought. > > L = lock, T = trylock > Thread1: L1 L2 > Thread2: L2 T1 > > Not a deadlock because the trylock will just fail. However, suppose we have: > > Thread1: L1 L2 > Thread2: L2 T1 > > And then later: > > Thread 3: L1 L2 > > When helgrind handles L2, it would already find the graph edge L1 -> L2 so wouldn't it just return > since that is the "correct order"? David sent me some past e-mail and I saw some comments about > putting lock vs trylock into the graph. Seems to me that when processing T2, helgrind would not > report a problem, but would add the T2 -> L1 link, and would also need to ensure that if L1 -> L2 > happens in the future, it is reported. Did not see much of the attached mails or discussions, so I guess the reference to the discussions on valusers is: http://thread.gmane.org/gmane.comp.debugging.valgrind/12616 Philippe |