- 论坛徽章:
- 0
|
我在ubuntu上调试程序,内核比较新,线程库中有pthread_tryjoin_np函数。但是实际环境是FC2:
内核是2.6.17, gcc (GCC) 3.3.3
线程库是:
/lib/tls/libpthread.so.0
NPTL 0.61 by Ulrich Drepper
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Forced unwind support include
编译程序:
gcc -Wall -g -std=c99 -D_GNU_SOURCE -pthread -c *.c
程序如下:
@:~$ cat 1.c
#define _GNU_SOURCE
#include <features.h>
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void fun()
{
printf("aaaaa\n");
sleep(10);
}
int
main()
{
// int pthread_create(pthread_t * thread, pthread_attr_t * attr, void * (*start_routine)(void *), void * arg);
//extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) __THROW;
pthread_t pid;
printf("create\n");
pthread_create(&pid, NULL, (void *)fun, NULL);
int i;
i=pthread_tryjoin_np(pid, NULL);
printf("i = %d \n", i);
exit(0);
}
|
有解决方案吗?
能不能升级一下线程库,只升级线程库,别升级glibc,那样动作太大。谢谢各位,在线等。。。
[ 本帖最后由 79hy 于 2009-6-10 10:34 编辑 ] |
|