Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jan 2019 21:22:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 234805] pthread_*_destroy doesn't handle locked objects consistently
Message-ID:  <bug-234805-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D234805

            Bug ID: 234805
           Summary: pthread_*_destroy doesn't handle locked objects
                    consistently
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: markj@FreeBSD.org

The POSIX entry for pthread_cond_destroy() says, "attempting to destroy a
condition variable upon which other threads are currently blocked results in
undefined behavior."  Our man page does not say this and instead documents =
an
error code of EBUSY as meaning "the variable cond is locked by another thre=
ad."
 However, the code does not attempt to detect this case and simply indicates
success.

OTOH, pthread_mutex_destroy() does check for this case and returns EBUSY.=20
pthread_rwlock_destroy() has the same behaviour as pthread_cond_destroy(), =
and
the compat10 sem_destroy() behaves like pthread_mutex_destroy().  We should=
 be
consistent about this.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-234805-227>