This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: pthread_cond_timedwait vs pthread_mutex_timedlock
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-help at sourceware dot org
- Cc: Borislav Trifonov <bdt at shaw dot ca>
- Date: Mon, 4 May 2009 19:43:51 -0400
- Subject: Re: pthread_cond_timedwait vs pthread_mutex_timedlock
- References: <12734907-1241464459-cardhu_decombobulator_blackberry.rim.net-1831994935-@bxe1305.bisx.prod.on.blackberry> <ce579e9512b30.49fedede@shaw.ca>
On Monday 04 May 2009 15:26:06 Borislav Trifonov wrote:
> But if the thread can just be woken when a condition occurs, then why is a
> mutex even needed?
waking at the right time does not guarantee exclusion, it just most often
works out that way. mutexes however absolutely guarantee exclusion.
-mike