- 論壇徽章:
- 0
|
我在ubuntu上調(diào)試程序,內(nèi)核比較新,線程庫(kù)中有pthread_tryjoin_np函數(shù)。但是實(shí)際環(huán)境是FC2:
內(nèi)核是2.6.17, gcc (GCC) 3.3.3
線程庫(kù)是:
/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);
}
|
有解決方案嗎?
能不能升級(jí)一下線程庫(kù),只升級(jí)線程庫(kù),別升級(jí)glibc,那樣動(dòng)作太大。謝謝各位,在線等。。。
[ 本帖最后由 79hy 于 2009-6-10 10:34 編輯 ] |
|