Re: Pthread error?

2011-07-30 Thread Jan Chludzinski
pthread_getthreadid_np is a non-standard IBM extension. You won't find it in the POSIX specs. Does Cygwin support the full POSIX pthread spec? ---Jan -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation:

Re: Pthread error?

2011-07-30 Thread Corinna Vinschen
On Jul 30 05:52, Jan Chludzinski wrote: pthread_getthreadid_np is a non-standard IBM extension. You won't find it in the POSIX specs. Does Cygwin support the full POSIX pthread spec? That would be nice, but, no, not yet. See http://cygwin.com/cygwin-api/compatibility.html In the next

Pthread error?

2011-07-29 Thread Jan Chludzinski
The code below appears to have incorrect behavior.  The output is: $ ./a.exe Enter Testcase - ./a Create/start threads Thread 009e0290 : Entered Thread 009f0320 : Entered Thread 009f03a8 : Entered Thread 18dbce64 : INITIALIZE RESOURCE Wait for the threads to

Re: Pthread error?

2011-07-29 Thread Eric Blake
On 07/29/2011 10:59 AM, Jan Chludzinski wrote: The code below appears to have incorrect behavior. The output is: Compile with -Wall. Thread 00a104f8 002a: The resource is 0 printf(Thread %.8x %.8x: resource is %d\n, pthread_self(), resource); Three uses of %, but only

Re: Pthread error?

2011-07-29 Thread Jan Chludzinski
Don't know why all the white space in the code turned intro ?. Hopefully this is better: #include pthread.h #include stdio.h #include stdlib.h #include unistd.h #define checkResults(string, val) { \ if (val) { \ printf(Failed with %d at %s,

Re: Pthread error?

2011-07-29 Thread Jan Chludzinski
Thanks! This is an example (from IBM) I cut-and-paste into Emacs to better understand pthread_once(...). Didn't notice the two %.8x in printf(). Thanks again, Jan -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation:

Re: Pthread error?

2011-07-29 Thread Jan Chludzinski
Can't blame IBM either. I had to replace pthread_getthreadid_np() (in the IBM example code) with pthread_self() because Cygwin doesn't support/have pthread_getthreadid_np(). And the IBM docs say pthread_getthreadid_np() returns a structure containing the hi and low order 4 bytes of the 64bit ID.

Re: Pthread error?

2011-07-29 Thread Corinna Vinschen
On Jul 29 13:29, Jan Chludzinski wrote: Can't blame IBM either. I had to replace pthread_getthreadid_np() (in the IBM example code) with pthread_self() because Cygwin doesn't support/have pthread_getthreadid_np(). pthread_getthreadid_np is a non-standard IBM extension. You won't find it in