This is the mail archive of the 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]

wrong pthread_mutexattr_init value bug?

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/
/* 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


Attachment: smime.p7s
Description: S/MIME cryptographic signature

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