mirror of https://github.com/apache/lucene.git
SOLR-215 -- synchronizing getSolrCore()
see: http://www.nabble.com/synchronization-issue-in-SolrCore.getSolrCore%28%29---tf4477891.html git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@577395 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
533f5cb7a5
commit
e3adf0ec78
|
@ -237,13 +237,16 @@ public final class SolrCore {
|
|||
*/
|
||||
@Deprecated
|
||||
public static SolrCore getSolrCore() {
|
||||
if( instance == null ) {
|
||||
try {
|
||||
instance = new SolrCore(null, new SolrConfig(), null);
|
||||
}
|
||||
catch(Exception xany) {
|
||||
log.throwing("SolrCore", "getSolrCore", xany);
|
||||
return null;
|
||||
synchronized( SolrCore.class ) {
|
||||
if( instance == null ) {
|
||||
try {
|
||||
// sets 'instance' to the latest solr core
|
||||
instance = new SolrCore(null, new SolrConfig(), null);
|
||||
}
|
||||
catch(Exception xany) {
|
||||
log.throwing("SolrCore", "getSolrCore", xany);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
|
|
Loading…
Reference in New Issue