The clear() method of ThreadLocalMap leaves the map in an inconsistent
state, causing errors during thread deletion in JikesRVM. Reported as
Bug #38576 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38576>. This
patch amends the clear() method to put the map back in a consistent but
empty state.
--
Robin Garner
--- ./components/classpath/97.2p7/classpath/java/lang/ThreadLocalMap.java 2008-12-09 17:35:48.000000000 +1100
+++ ./libraryInterface/Common/src/java/lang/ThreadLocalMap.java 2008-12-17 11:40:22.000000000 +1100
@@ -301,7 +301,9 @@
* Clear out the map. Done once during thread death.
*/
void clear() {
- entries = null;
+ this.entries = new Entry[1];
+ this.count = 0;
+ this.hashMask = 0;
}
/**