delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/09/16:00:21

From: "ken wang" <cukuwang AT pchome DOT com DOT tw>
Newsgroups: comp.os.msdos.djgpp
Subject: the problem of posix threads in djgpp
Date: Thu, 10 Oct 2002 04:04:26 +0800
Organization: DCI HiNet
Lines: 66
Message-ID: <ao21or$r02@netnews.hinet.net>
NNTP-Posting-Host: 61-217-0-112.hinet-ip.hinet.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019