Subj : Re: Improving read-write lock To : comp.programming.threads From : Marcin 'Qrczak' Kowalczyk Date : Thu Feb 24 2005 09:11 pm "Joe Seigh" writes: >> Code that leaves data in an invalid state when an exception >> propagates out is broken anyway. It won't matter whether you unlock >> the mutex or not. > > It obvious when a program hangs when an lock is not unlocked. It not > always so obvious when a program has incorrect results because data > is corrupted. This situation should be detected by the fact that an exception is thrown where it shouldn't be. It's unwise to optimize the semantics for buggy programs, while at the same time breaking sensible uses of exceptions thrown while mutexes are held (e.g. if the mutex is used to read the data). -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ .