From: Steve Graegert <graegerts@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: pthread_mutex_destroy call in nptl-2.3.4 thread libraries
Date: Mon, 6 Feb 2006 18:03:57 +0100 [thread overview]
Message-ID: <6a00c8d50602060903i6aee9348i39e359aaa59f4617@mail.gmail.com> (raw)
In-Reply-To: <8d1265000602060820t247b6f18kf79f72e3bb131cb8@mail.gmail.com>
On 2/6/06, Senthil Nathan V <pingtosen@gmail.com> wrote:
> Hi All,
> I am learning multi-threaded programming in Linux. Locking a
> deleted mutex is possible in nptl threads.
Don't know what you mean here. Locking a destroyed (thus,
uninitialized mutex) returns EINVAL.
> Now my query is :
> * Is there any possible way to check for destroyed mutex ?
Are you looking for a function that lists destroyed mutexes? If so,
there is none. If not, calling pthread_mutex_destroy() will fail if
the mutex is invalid (probably destroyed). pthread_mutex_lock()
returns EINVAL if called for a destroyed (and unitialized) mutex.
Additionally, pthread_mutex_init __may__ return EBUSY if you try to
reinitialize a mutex which has been previously intialized, but not yet
destroyed. You may want to combine these calls to detect a destroyed
mutex, although I do __not__ recommend it.
\Steve
--
Steve Graegert <graegerts@gmail.com>
Software Consultant {C/C++ && Java && .NET}
Office: +49 9131 7123988
Mobile: +49 1520 9289212
next prev parent reply other threads:[~2006-02-06 17:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8d1265000602060818n6a1c499che2828236645252f4@mail.gmail.com>
2006-02-06 16:20 ` pthread_mutex_destroy call in nptl-2.3.4 thread libraries Senthil Nathan V
2006-02-06 17:03 ` Steve Graegert [this message]
2006-02-07 4:50 ` Senthil Nathan V
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=6a00c8d50602060903i6aee9348i39e359aaa59f4617@mail.gmail.com \
--to=graegerts@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).