From: Jakub Jelinek <jakub@redhat.com>
To: tom@kavaga.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible 2.6.24-rc7 issue w/respect to pthreads
Date: Wed, 9 Jan 2008 05:53:04 -0500 [thread overview]
Message-ID: <20080109105304.GI15450@devserv.devel.redhat.com> (raw)
In-Reply-To: <39848.76.189.45.79.1199874932.squirrel@webmail.kavaga.com>
On Wed, Jan 09, 2008 at 02:35:32AM -0800, tom@kavaga.com wrote:
> After I patched my 2.6.23 kernel to 2.6.24-rc7 this morning, I noticed
> some odd behavior with respect to POSIX threads in a test program I had
> written (originally to test epoll.)
>
> The behavior is as follows:
>
> 1. main() creates a new thread of execution with pthread_create
> 2. thread_func() immediately calls pthread_detach(), which is supposed to
> ensure that thread resources are cleaned up when the thread terminates.
> 3. The spawned thread sleeps and then prints a message "got here"
> 4. The main thread calls pthread_join(). According to the POSIX
> documentation, this should suspend execution until the spawned thread has
> terminated.
Your testcase is buggy. Detached threads aren't joinable, you can't call
pthread_join on them.
Jakub
next prev parent reply other threads:[~2008-01-09 10:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 10:35 Possible 2.6.24-rc7 issue w/respect to pthreads tom
2008-01-09 10:51 ` Marc Kleine-Budde
2008-01-09 10:53 ` Jakub Jelinek [this message]
2008-01-09 11:07 ` Eric Dumazet
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=20080109105304.GI15450@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tom@kavaga.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