Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

the problem of posix threads in djgpp

72 views
Skip to first unread message

ken wang

unread,
Oct 9, 2002, 4:04:26 PM10/9/02
to
hi,
i just got FSU Pthreads from http://moss.csc.ncsu.edu/~mueller/pthreads/ ,
after modify some mirror mistake in the makefile and some code file. i can
make the library. Then i try a small program to test it. it seem work fine.
but i still has some question?!
(1) the modifide part:
(1.1) line 40 of pthread.c: #include "tdi.h" ---> #include
"..\tdi\include\tdi.h"
(1.2) line 140 of pthread.c: #endif; --> #endif
(1.3) line 607 of pthread.c: __pthread_debug_TDI_ignored_signals |= 0x1 <<
(SIGALRM-1); ---> // __pthread_debug_TDI_ignored_signals |= 0x1 <<
(SIGALRM-1);
(1.4) line 55 of wait.c: #else /* /* !STACK_CHECK || !SIGNAL_STACK */
*/ ---> #else /* !STACK_CHECK || !SIGNAL_STACK */
(1.5) line 57 of wait.c: #endif /* /* !STACK_CHECK || !SIGNAL_STACK */
*/ ---> #endif /* !STACK_CHECK || !SIGNAL_STACK */
(1.6) line 177 of wait.c: #endif /* /* SCO5 */SCO5 */ ---> #endif /* /* SCO5
*/SCO5 */ ---> #endif /* SCO5 */
(1.7) line 127 of tdi.h: #endif /* /* __tdi_h__ */ */ ---> #endif /*
__tdi_h__ */
(1.8) line of tdi-aux.c: #endif /* /* TDI_SUPPORT */ */ ---> #endif /*
TDI_SUPPORT */
(1.9) add #define __DOS__ in the pthreads.h
(1.10) modify the makefile for backslash problem.

(2) the test program:
#include <stdio.h>
#include <pthread.h>
void ChildThread(void *);
int main(void){

pthread_t hThread;
int retn;

retn = pthread_create(&hThread, NULL, (void *)ChildThread, NULL); //
Create Thread

if(retn<0){
printf("Thread Creation Failed\n");
return 1;
}

pthread_join(hThread, NULL); // Parent waits for

printf("Parent is continuing....\n");

return 0;
}

void ChildThread(void *argument){
int i;
for(i=1;i<=100;++i){
printf(" Child Count - %d\n",i);
}
pthread_exit(0);
}

(3) environment:
win98se, djgpp 2.03, FSU Pthreads 3.14

(4) my question is if (1.3) will make some unknown side-effect. or, some guy
know how to solve this linking problem?

ken


0 new messages