This is the mail archive of the cygwin mailing list for the Cygwin 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]

Re: Problems with pthread mutexes


Hi Brian,

The result I get back is 16 which according to stderror is: "Mount device busy".
The mutex is being created within a running thread. It is very strange
that the same code compiles fine on other OS and that they don't give
back an error.


I'll try writing up a more simpler example that can be run,
also I'm compiling with -O3,I'm not sure how cygwin's modes
to gcc effect this level of optimization.



Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net




It must be something your code is doing wrong -- something not in the
above snippet.  I think you'll find that if you can narrow it down to a
simple testcase that compiles and exhibits the error it will be much
easier to find out what's wrong.  Your above code works fine for me:

$ cat >pthread_mutexattr.c <<EOF && \
gcc -o pthread_mutexattr.exe pthread_mutexattr.c && \
./pthread_mutexattr
#include <pthread.h>
#include <stdlib.h>

int main() {
   int result;
   pthread_mutexattr_t mutex_attr;

  if ((result = pthread_mutexattr_init(&mutex_attr)) != 0)
      perror("pthread_mutexattr_init");
   else
      printf("success");
}
EOF
success

Brian

--













.




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]