wrong pthread_mutexattr_init value bug?

Joost Kraaijeveld J.Kraaijeveld@Askesis.nl
Tue Oct 14 14:04:00 GMT 2003


According to the Cygwin sources the function pthread_mutexattr_init (see
below) can return EBUSY. As far as I can see in several docs, this is
not a valid return value. According to the IEEE Std 1003.1 online docs
only ENOMEM or 0 are valid return values. 

Besides this, why should this function return a different value after
the first test for "pthread_mutexattr::is_good_object (attr)", EBUSY
than after the second test (0)?

Is this a bug?

Except from the code in winsup/cygwin/thread.cc
.....
/* FIXME: write and test process shared mutex's.  */
extern "C" int
pthread_mutexattr_init (pthread_mutexattr_t *attr)
{
  if (pthread_mutexattr::is_good_object (attr))
    return EBUSY;

  *attr = new pthread_mutexattr ();
  if (!pthread_mutexattr::is_good_object (attr))
    {
      delete (*attr);
      *attr = NULL;
      return ENOMEM;
    }
  return 0;
}
...


Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
email: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl 


 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2226 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20031014/b5a192e2/attachment.bin>


More information about the Cygwin mailing list