This is the mail archive of the cygwin@cygwin.com 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]

Bug in pthread_equal


There seems to be a bug in pthread_equal:

    int pthread_equal(pthread_t t1, pthread_t t2)

should return a non-zero value if t1 and t2 refer to the same thread, and a 
zero value otherwise. With the Cygwin DLL 1.3.2 implementation, it is the other 
way around: the function returns zero if t1 and t2 refer to the same thread, 
and a non-zero value otherwise.

One way to solve this would be to change
cygwin-1.3.2-1/winsup/cygwin/thread.cc, at line 1811: replace 

int
__pthread_equal (pthread_t * t1, pthread_t * t2)
{
  return (*t1 - *t2);
}

with

int
__pthread_equal (pthread_t * t1, pthread_t * t2)
{
  return (*t1 == *t2);
}

(I did not test this, though.)

Pieter

P.S. Please cc: any replies to me as I don't read this mailing list.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.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]