comparison src/share/vm/interpreter/interpreterRuntime.cpp @ 1986:9bc798875b2a

6704010: Internal Error (src/share/vm/interpreter/interpreterRuntime.cpp:1106) Summary: Fixed a race condition in the assertion caused by an unguarded, concurrent access to a GrowableArray object. Reviewed-by: coleenp, dholmes, dsamersoff Contributed-by: volker.simonis@gmail.com
author coleenp
date Sat, 04 Dec 2010 00:09:05 -0500
parents f95d63e2154a
children dd031b2226de 8012aa3ccede
comparison
equal deleted inserted replaced
1985:cb2d0a362639 1986:9bc798875b2a
1191 } else { 1191 } else {
1192 // set handler 1192 // set handler
1193 method->set_signature_handler(_handlers->at(handler_index)); 1193 method->set_signature_handler(_handlers->at(handler_index));
1194 } 1194 }
1195 } 1195 }
1196 #ifdef ASSERT
1197 int handler_index, fingerprint_index;
1198 {
1199 // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized
1200 // in any way if accessed from multiple threads. To avoid races with another
1201 // thread which may change the arrays in the above, mutex protected block, we
1202 // have to protect this read access here with the same mutex as well!
1203 MutexLocker mu(SignatureHandlerLibrary_lock);
1204 handler_index = _handlers->find(method->signature_handler());
1205 fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint());
1206 }
1196 assert(method->signature_handler() == Interpreter::slow_signature_handler() || 1207 assert(method->signature_handler() == Interpreter::slow_signature_handler() ||
1197 _handlers->find(method->signature_handler()) == _fingerprints->find(Fingerprinter(method).fingerprint()), 1208 handler_index == fingerprint_index, "sanity check");
1198 "sanity check"); 1209 #endif
1199 } 1210 }
1200 1211
1201 1212
1202 BufferBlob* SignatureHandlerLibrary::_handler_blob = NULL; 1213 BufferBlob* SignatureHandlerLibrary::_handler_blob = NULL;
1203 address SignatureHandlerLibrary::_handler = NULL; 1214 address SignatureHandlerLibrary::_handler = NULL;