Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2019 17:32:35 +0800
From:      Erich Dollansky <freebsd.ed.lists@sumeritec.com>
To:        Daniel Eischen <deischen@freebsd.org>
Cc:        freebsd-questions@freebsd.org, freebsd-threads@freebsd.org
Subject:   Re: mutex held in a thread which is cancelled stays busy
Message-ID:  <20190809173235.2b6aa029.freebsd.ed.lists@sumeritec.com>
In-Reply-To: <BC58A1D4-C77A-49F4-B6D6-F85A8C13832E@freebsd.org>
References:  <20190806165429.14bc4052.freebsd.ed.lists@sumeritec.com> <1FC05CEB-982F-484F-9E41-5A74FF564494@freebsd.org> <20190807071002.GF2731@kib.kiev.ua> <20190807163757.2b5d52fa.freebsd.ed.lists@sumeritec.com> <20190807092035.GG2731@kib.kiev.ua> <AFA42FF8-C49F-495F-BD4A-F9FBB9301F5E@freebsd.org> <20190807182548.1a8e00dd.freebsd.ed.lists@sumeritec.com> <BC58A1D4-C77A-49F4-B6D6-F85A8C13832E@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Wed, 7 Aug 2019 13:26:31 -0400
Daniel Eischen <deischen@freebsd.org> wrote:

> > On Aug 7, 2019, at 6:25 AM, Erich Dollansky
> > <freebsd.ed.lists@sumeritec.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190809173235.2b6aa029.freebsd.ed.lists>