From: chrubis@suse.cz
To: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Cc: Garrett Cooper <yanegomi@gmail.com>,
LTP <ltp-list@lists.sourceforge.net>,
Mike Frysinger <vapier@gentoo.org>
Subject: Re: [LTP] [PATCH 1/4] pthread_cond_timedwait/2-4: allow pthread_mutex_trylock return EDEADLK
Date: Wed, 10 Jul 2013 18:35:26 +0200 [thread overview]
Message-ID: <20130710163525.GA20440@rei.Home> (raw)
In-Reply-To: <1373467521-2291-1-git-send-email-gaowanlong@cn.fujitsu.com>
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
parent reply other threads:[~2013-07-10 16:33 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1373467521-2291-1-git-send-email-gaowanlong@cn.fujitsu.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130710163525.GA20440@rei.Home \
--to=chrubis@suse.cz \
--cc=gaowanlong@cn.fujitsu.com \
--cc=ltp-list@lists.sourceforge.net \
--cc=vapier@gentoo.org \
--cc=yanegomi@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox