From: Vladimir T. <vtz...@gm...> - 2009-06-26 14:19:18
|
On 6/26/09, Sam Steingold <sd...@gn...> wrote: > Vladimir Tzankov wrote: >> If thread owns >> a lock and unlocks it and after this locks it again - the second time >> xlock_lock_helper() will not really acquire the mutex since the _owner >> will be still the same (all this if _owner is not invalidated and >> there is no other thread that got the lock between meanwhile. I've >> experience exactly this with the tests that you've added for hash >> table and packages). > > that's OK. > my point is that before accessing the owner field, we must assure that the > owned field is set. this is safe and clean. ok, got it. Will use it and commit. > > BTW, why did you decide to name the fields with a leading "_"? > it would have been much nicer if the names followed the usual unix > convention > (cf. stat), e.g., xl_owner &c (and the names should be longer and more > mnemonic > and greppable). Will change them as well (xlock_t started as experiment how to interrupt while waiting on mutex and thus shorter names remained). |