Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Mutex lock counter thread-safe?



On 24 May 2004 Lars von Wedel <vonwedel@web.de> wrote:

> there is a counter variable "locked" in cMutex in thread.h,c. There is 
> no separate lock for reading/writing this counter variable.
> 
> Shouldn't there be an extra lock in order to let multiple threads 
> properly treat this member variable?

As you can see the counter is incremented after locking and
decremented before unlocking the mutex, so the counter is (IMO)
protected by the mutex it self.

-- 
Stefan Huelswitt
s.huelswitt@gmx.de  | http://www.muempf.de/


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index