lkml.org 
[lkml]   [2002]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Weird bug in linux, glibc, gcc or what?
On Thu, 7 Feb 2002, Felipe Contreras wrote:

> I've found a weird problem in linuxthreads. When I get out of a thread it
> happends one of three, the new thread get's defuct and the proccess never
> ends, it segfaults, or it works.
[snip]
> #include <pthread.h>
>
> void *test(void *arg) {
> puts("Thread2");
> return 0;
> }
>
> int main() {
> pthread_t tt;
> puts("Before Thread2");
> pthread_create(&tt,NULL,test,NULL);
> puts("After Thread2");
> return 0;
> }

Try this patch and see if it works:

--- thr_test.c Fri Feb 8 09:45:35 2002
+++ thr_test1.c Fri Feb 8 09:45:36 2002
@@ -10,5 +10,6 @@ int main() {
puts("Before Thread2");
pthread_create(&tt,NULL,test,NULL);
puts("After Thread2");
+ pthread_join(tt, NULL);
return 0;
}
--
Catalin


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.030 / U:7.488 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site