From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Johnson To: Aurelio Medina , "'Le Coent Yannick'" , pthreads-win32@sourceware.cygnus.com Subject: Re: Last version of message queues. Date: Thu, 02 Aug 2001 21:48:00 -0000 Message-id: <3B6A2D34.B30BCD6D@ise.canberra.edu.au> References: <1BDB01B13696D411BD6200D0B7C854EA011768FC@chi-prd-mail1.xcaliber.com> <3B69FBEA.B868A11D@ise.canberra.edu.au> X-SW-Source: 2001/msg00092.html Aurelio, Ross Johnson wrote: > > Hi Aurelio, > > Last time I looked you needed PTHREAD_PROCESS_SHARED mutexes > and condition variables. The code you just sent does the same > as last time. > > _POSIX_THREAD_PROCESS_SHARED isn't defined in pthreads-win32, nor > in Linux I believe (although I could be out of date there). > > For example, in mq_open() you have the following code: > > if ( (i = pthread_mutexattr_init(&mattr)) != 0) > goto pthreaderr; > pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); > i = pthread_mutex_init(&mqhdr->mqh_lock, &mattr); > pthread_mutexattr_destroy(&mattr); /* be sure to destroy */ > if (i != 0) > goto pthreaderr; > > if ( (i = pthread_condattr_init(&cattr)) != 0) > goto pthreaderr; > pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED); > i = pthread_cond_init(&mqhdr->mqh_wait, &cattr); > > The *attr_setpshared() calls will be returning ENOSYS errors. > I apologise - it's pthread_{mutex,cond}_init() that should be returning ENOSYS, not *attr_setpshared(). Since you're catching that I'm now confused so I'll go take a longer harder look. Sorry. Ross