From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95542 invoked by alias); 29 Dec 2017 16:10:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 95501 invoked by uid 89); 29 Dec 2017 16:10:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-out.m-online.net Received: from mail-out.m-online.net (HELO mail-out.m-online.net) (212.18.0.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Dec 2017 16:10:02 +0000 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3z7Wkv5SjPz1qvn5; Fri, 29 Dec 2017 17:09:59 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3z7Wkv3M49z1qqkt; Fri, 29 Dec 2017 17:09:59 +0100 (CET) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id eeGfVpOvQAFZ; Fri, 29 Dec 2017 17:09:58 +0100 (CET) X-Auth-Info: Dl8fYNaKMuNLwkj61I4ZEPhBm/U7YiI6DXKTfhrAaDmb+8j1GzIAvNMMc+5Q0V5V Received: from localhost (ppp-188-174-152-179.dynamic.mnet-online.de [188.174.152.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 29 Dec 2017 17:09:58 +0100 (CET) Received: by localhost (Postfix, from userid 1000) id 90AD92C3191; Fri, 29 Dec 2017 17:09:57 +0100 (CET) From: Andreas Schwab To: =?utf-8?Q?Fran=C3=A7ois?= Dumont Cc: Jonathan Wakely , "libstdc++\@gcc.gnu.org" , gcc-patches Subject: Re: debug container mutex association References: <46b4f297-c0da-b0b0-03ef-bba019b97ec7@gmail.com> <20160914090036.GC17376@redhat.com> <20160915085143.GJ17376@redhat.com> <2af7879c-bef5-7874-b5ae-722ad3a1e171@gmail.com> X-Yow: AIEEEEE! I am having an UNDULATING EXPERIENCE! Date: Fri, 29 Dec 2017 16:10:00 -0000 In-Reply-To: <2af7879c-bef5-7874-b5ae-722ad3a1e171@gmail.com> (=?utf-8?Q?=22Fran=C3=A7ois?= Dumont"'s message of "Mon, 19 Sep 2016 21:56:58 +0200") Message-ID: <87lghlikh6.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2017-12/txt/msg01592.txt.bz2 On Sep 19 2016, François Dumont wrote: > diff --git a/libstdc++-v3/testsuite/23_containers/vector/debug/mutex_association.cc b/libstdc++-v3/testsuite/23_containers/vector/debug/mutex_association.cc > new file mode 100644 > index 0000000..a3c56e2 > --- /dev/null > +++ b/libstdc++-v3/testsuite/23_containers/vector/debug/mutex_association.cc > @@ -0,0 +1,42 @@ > +// Copyright (C) 2016 Free Software Foundation, Inc. > +// > +// This file is part of the GNU ISO C++ Library. This library is free > +// software; you can redistribute it and/or modify it under the > +// terms of the GNU General Public License as published by the > +// Free Software Foundation; either version 3, or (at your option) > +// any later version. > +// > +// This library is distributed in the hope that it will be useful, > +// but WITHOUT ANY WARRANTY; without even the implied warranty of > +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +// GNU General Public License for more details. > +// > +// You should have received a copy of the GNU General Public License along > +// with this library; see the file COPYING3. If not see > +// . > +// > + > +#include > +#include > + > +#include > + > +class container : public __gnu_debug::_Safe_sequence > +{ > +public: > + __gnu_cxx::__mutex& > + get_mutex() > + { return this->_M_get_mutex(); } > +}; > + > +int > +main() > +{ > + std::set<__gnu_cxx::__mutex*> mutexes; > + container conts[17]; > + > + for (int i = 0; i != 16; ++i) > + VERIFY( mutexes.insert(&conts[i].get_mutex()).second ); There will be less than 16 unique mutexes, if sizeof(container) has more trailing zero bits than alignof(__gnu_debug::vector). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."