re PR libgcj/23367 (_Jv_FindMethodInCache is not thread-safe)

PR libgcj/23367:
	* include/jvm.h (_Jv_FreeMethodCache): Declare.
	* java/lang/natClass.cc (MCACHE_SIZE): Conditional on HAVE_TLS.
	(struct _Jv_mcache): Likewise.
	(method_cache): Likewise.
	(_Jv_FindMethodInCache): Do nothing unless TLS is available.
	(_Jv_AddMethodToCache): Likewise.
	(_Jv_FreeMethodCache): New function.
	* java/lang/natThread.cc (finish_): Call _Jv_FreeMethodCache.
	* aclocal.m4, configure, include/config.h.in: Rebuilt.
	* configure.ac: Invoke GCC_CHECK_TLS.

From-SVN: r104707
This commit is contained in:
Tom Tromey 2005-09-27 20:03:09 +00:00 committed by Tom Tromey
parent ab3fa9d344
commit b9e6a2e5de
12 changed files with 221 additions and 34 deletions

View file

@ -214,7 +214,10 @@ java::lang::Thread::finish_ ()
#endif
group = NULL;
// If a method cache was created, free it.
_Jv_FreeMethodCache();
// Signal any threads that are waiting to join() us.
_Jv_MutexLock (&nt->join_mutex);