public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/59807] New: mutex misses destructor if non-function call initialization is used
@ 2014-01-14 15:30 ahanins at gmail dot com
  2014-01-14 15:33 ` [Bug libstdc++/59807] " ahanins at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ahanins at gmail dot com @ 2014-01-14 15:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59807

            Bug ID: 59807
           Summary: mutex misses destructor if non-function call
                    initialization is used
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ahanins at gmail dot com

Hi,
  Follow up to https://sourceforge.net/p/mingw-w64/bugs/376/

  This is related to GTHR interface to pthread.

  C++11 __mutex_base class does not define a destructor if __GTHREAD_MUTEX_INIT
is defined. It means, underlying implementation (pthread for example) has no
any means to do a resource cleanup when std::mutex is destructed. In
particular, it causes semaphore object resource (handle) leak on Windows in
MinGW winpthread implementation where semaphore object is created during first
pthread_mutex_lock invocation.
  Wouldn't it be more robust to always define a destructor for __mutex_base
which calls __gthread_mutex_destroy, or even more flexibly, introduce a
separate macro like __GTHREAD_MUTEX_DESTROY_FUNCTION which controls whether
destructor should be defined at all or not.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-10-14 13:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14 15:30 [Bug libstdc++/59807] New: mutex misses destructor if non-function call initialization is used ahanins at gmail dot com
2014-01-14 15:33 ` [Bug libstdc++/59807] " ahanins at gmail dot com
2014-01-14 17:19 ` redi at gcc dot gnu.org
2014-01-14 17:22 ` redi at gcc dot gnu.org
2014-01-29 19:03 ` ahanins at gmail dot com
2014-01-29 19:53 ` redi at gcc dot gnu.org
2014-01-29 20:26 ` ktietz at gcc dot gnu.org
2014-01-30  7:32 ` ahanins at gmail dot com
2014-10-14 12:38 ` redi at gcc dot gnu.org
2014-10-14 13:09 ` ktietz at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).