Borland C++Builder support

Gianluca gianlucaspm@pochta.ru
Tue Aug 3 10:04:00 GMT 2004


I have built the library with the Will Bryant's bmakefile.
I've received a bunch of warnings but it was OK.
I put the PthreadBC.dll on Windows directory, I included
PthreadBC.lib in my .bpr project, I compiled and linked the 
program below.

#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>

void*  function( void*  arg )
{
   printf( "This is thread %d\n", pthread_self() );
   return( 0 );
}

int main( void )
{
   pthread_attr_t attr;

   pthread_attr_init( &attr );
   pthread_attr_setdetachstate(
      &attr, PTHREAD_CREATE_DETACHED );
   pthread_create( NULL, &attr, &function, NULL );

   /* Allow threads to run for 10 seconds. */
   sleep(10);
   return EXIT_SUCCESS;
}

On debugging the thread writes out "This is thread 19922" and does 
not return.
If I run the executable just created Win XP gives me error.

Could someone help me?

Thanks in advance,
Gianluca



More information about the Pthreads-win32 mailing list