mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 06:45:43 +02:00
[328060] [dstore] command queue in Miner should be synchronized
This commit is contained in:
parent
b73246c9d8
commit
19765ed8c0
1 changed files with 10 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
* Copyright (c) 2002, 2010 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -18,6 +18,7 @@
|
||||||
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
|
* David McKnight (IBM) - [226561] [apidoc] Add API markup to RSE Javadocs where extend / implement is allowed
|
||||||
* Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers
|
* Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers
|
||||||
* David McKnight (IBM) - [232004] [dstore][multithread] some miner finish() is not terminated sometimes
|
* David McKnight (IBM) - [232004] [dstore][multithread] some miner finish() is not terminated sometimes
|
||||||
|
* David McKnight (IBM) - [328060] [dstore] command queue in Miner should be synchronized
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.dstore.core.miners;
|
package org.eclipse.dstore.core.miners;
|
||||||
|
@ -216,7 +217,11 @@ implements ISchemaExtender
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
DataElement cmd = (DataElement)_commandQueue.remove(0);
|
DataElement cmd = null;
|
||||||
|
synchronized (_commandQueue){
|
||||||
|
cmd = (DataElement)_commandQueue.remove(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (cmd != null){
|
if (cmd != null){
|
||||||
command(cmd);
|
command(cmd);
|
||||||
}
|
}
|
||||||
|
@ -229,7 +234,9 @@ implements ISchemaExtender
|
||||||
|
|
||||||
public final void requestCommand(DataElement command)
|
public final void requestCommand(DataElement command)
|
||||||
{
|
{
|
||||||
_commandQueue.add(command);
|
synchronized (_commandQueue){
|
||||||
|
_commandQueue.add(command);
|
||||||
|
}
|
||||||
notifyInput();
|
notifyInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue