Why do pthreads implementations differ in error conditions?
taylor@template.com wrote: > I’d like to understand why pthreads implementations from different > vendors define error conditions differently. For example, if > pthread_mutex_unlock is called for a mutex that is not owned by the > calling thread. > > Under Solaris 2.5: “If the calling thread is not the owner of the > lock, no error status is returned, and the behavior of the program > is undefined.” > > Under AIX 4.2: It returns the EPERM error code. > > The problem may be that the AIX 4.2 implementation is based on draft 7 > of the pthreads spec, not the standard, but I certainly prefer the AIX > approach. > > Another example: pthread_mutex_lock is called for a mutex that is > already owned by the calling thread. > > Under Solaris 2.5: “If the current owner of a mutex tries to relock > the mutex, it will result in deadlock.” (The process hangs.) > > Under AIX 4.2: It returns the EDEADLK error code. > > Once again, the AIX approach certainly seems preferable. > > Aren’t these issues cl