This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v3] __pool_alloc locking bits
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Richard Earnshaw <rearnsha at gcc dot gnu dot org>, bkoz at redhat dot com,libstdc++ at gcc dot gnu dot org
- Date: Fri, 25 Jun 2004 17:25:25 +0100
- Subject: Re: [v3] __pool_alloc locking bits
- Organization: CodeSourcery
- References: <1088176043.19565.42.camel@pc960.cambridge.arm.com>
On Friday 25 June 2004 16:07, Richard Earnshaw wrote:
> Ben,
> 2004-06-24 Benjamin Kosnik <bkoz@redhat.com>
>
> * include/bits/concurrence.h (__gnu_cxx::lock): New.
> * include/ext/pool_allocator.h (__pool_base::_Lock::_S_lock): Remove.
> (__pool_base::_M_get_mutex): New.
> * include/bits/allocator.h: Tweak.
> * src/allocator.cc (__pool_base::_M_get_free_list): Correct offset.
> * config/linker-map.gnu: Remove __pool_base::_Lock::_S_lock.
> * include/bits/stl_threads.h: Remove.
> * include/Makefile.am: Also here.
> * include/Makefile.in: Regenerate.
>
> * src/locale_init.cc: Use __gnu_cxx::lock.
>
> * src/allocator.cc: Move all instantiations...
> * src/allocator-inst.cc: ...here.
>
> This patch breaks cross-compilation to arm-elf:
The following seems to fix it.
Ok?
Paul
2004-06-25 Paul Brook <paul@codesourcery.com>
* include/bits/concurrence.h: Still create mutex object when
single-threaded.
Index: include/bits/concurrence.h
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/libstdc++-v3/include/bits/concurrence.h,v
retrieving revision 1.4
diff -u -p -r1.4 concurrence.h
--- include/bits/concurrence.h 25 Jun 2004 06:10:43 -0000 1.4
+++ include/bits/concurrence.h 25 Jun 2004 16:08:18 -0000
@@ -56,7 +56,7 @@ __gthread_mutex_lock(&NAME)
#else
-# define __glibcxx_mutex_define_initialized(NAME)
+# define __glibcxx_mutex_define_initialized(NAME) __gthread_mutex_t NAME
# define __glibcxx_mutex_lock(NAME)
# define __glibcxx_mutex_unlock(NAME)