$OpenBSD: patch-hotspot_src_os_bsd_vm_thread_bsd_inline_hpp,v 1.1.1.1 2005/05/25 17:27:53 kurt Exp $
--- hotspot/src/os/bsd/vm/thread_bsd.inline.hpp.orig	Tue May 24 12:18:17 2005
+++ hotspot/src/os/bsd/vm/thread_bsd.inline.hpp	Tue May 24 12:19:33 2005
@@ -19,11 +19,6 @@ inline Thread* ThreadLocalStorage::threa
 
   uintptr_t raw = pd_raw_thread_id();
   int ix = pd_cache_index(raw);
-  Thread *Candidate = ThreadLocalStorage::_get_thread_cache[ix];
-  if (Candidate->_self_raw_id == raw) {
-    // hit
-    return Candidate;
-  } else {
-    return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix);
-  }
+  // avoid a race with _get_thread_cache
+  return ThreadLocalStorage::get_thread_via_cache_slowly(raw, ix);
 }
