* Re: [LTP] [PATCH 1/4] pthread_cond_timedwait/2-4: allow pthread_mutex_trylock return EDEADLK
[not found] <1373467521-2291-1-git-send-email-gaowanlong@cn.fujitsu.com>
@ 2013-07-10 16:35 ` chrubis
0 siblings, 0 replies; only message in thread
From: chrubis @ 2013-07-10 16:35 UTC (permalink / raw)
To: Wanlong Gao; +Cc: Garrett Cooper, LTP, Mike Frysinger
Hi!
> POSIX said: (Sure it is unclear)
> The pthread_mutex_lock() function shall fail if:
>
> [EDEADLK]
> The mutex type is PTHREAD_MUTEX_ERRORCHECK and the current thread already owns the mutex.
>
> The pthread_mutex_trylock() function shall fail if:
>
> [EBUSY]
> The mutex could not be acquired because it was already locked.
>
> So we should allow pthread_mutex_trylock return EDEADLK or EBUSY
> when the mutex is already owned.
Looking at the POSIX spec the EDEADLK is specified as possible error
__only__ for pthread_mutex_lock().
So if pthread_mutex_trylock() returned EDEADLK your libc is buggy. Where
have you seen this happen?
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-07-10 16:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1373467521-2291-1-git-send-email-gaowanlong@cn.fujitsu.com>
2013-07-10 16:35 ` [LTP] [PATCH 1/4] pthread_cond_timedwait/2-4: allow pthread_mutex_trylock return EDEADLK chrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox