Re: mutex held in a thread which is cancelled stays busy

Erich Dollansky <[email protected]>
Newsgroups gmane.os.freebsd.questions,gmane.os.freebsd.devel.threading
Message-ID <[email protected]>
Hi,

On Wed, 7 Aug 2019 13:26:31 -0400
Daniel Eischen <[email protected]> wrote:

> > On Aug 7, 2019, at 6:25 AM, Erich Dollansky
> > <[email protected]> wrote:
> > 
> >> Erich, are you getting EBUSY for pthread_mutex_lock() or is that
> >> only for pthread_mutex_trylock()?
> >>   
> > EBUSY is only returned when I call 'pthread_mutex_trylock'. The
> > other one just hangs.  
> 
> In this case, I think FreeBSD is behaving correctly.  I think perhaps
> the only problem is that the man page isn't reflecting the POSIX
> wording.

I only could go back to my test program now. I made the wrong
assumption that 'EOWNERDEAD' will be repeated. This error message comes
only one time. The caller has then to call 'pthread_mutex_consistent'
to correct the error. Having a program which misses one return value
leads to the problem I have had.

At least we learned with this that FreeBSD's version of pthreads is a
much more practical attempt than some others. 

Erich
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.