This is the mail archive of the pthreads-win32@sources.redhat.com mailing list for the pthreas-win32 project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I have built the library with the Will Bryant's bmakefile.In general (ie. not for pthreads-win32 specifically), you need to declare a pthread_id_t and pass it's address as the first argument to pthread_create. Try making that change first.
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 );
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |