[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080109105304.GI15450@devserv.devel.redhat.com>
Date: Wed, 9 Jan 2008 05:53:04 -0500
From: Jakub Jelinek <jakub@...hat.com>
To: tom@...aga.com
Cc: linux-kernel@...r.kernel.org
Subject: Re: Possible 2.6.24-rc7 issue w/respect to pthreads
On Wed, Jan 09, 2008 at 02:35:32AM -0800, tom@...aga.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists