Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 404082 | Differences between
and this patch

Collapse All | Expand All

(-)a/rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/server/ServerUpdateHandler.java (-12 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2002, 2012 IBM Corporation and others.
2
 * Copyright (c) 2002, 2013 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 17-22 Link Here
17
 * David McKnight  (IBM)   [246826][dstore] KeepAlive does not work correctly
17
 * David McKnight  (IBM)   [246826][dstore] KeepAlive does not work correctly
18
 * David McKnight    (IBM)  - [358301] [DSTORE] Hang during debug source look up
18
 * David McKnight    (IBM)  - [358301] [DSTORE] Hang during debug source look up
19
 * David McKnight  (IBM)   [388873][dstore] ServerUpdateHandler _senders list should be synchronized
19
 * David McKnight  (IBM)   [388873][dstore] ServerUpdateHandler _senders list should be synchronized
20
 * David McKnight  (IBM)   [404082][dstore] race condition on finish, removing senders
20
 *******************************************************************************/
21
 *******************************************************************************/
21
22
22
package org.eclipse.dstore.internal.core.server;
23
package org.eclipse.dstore.internal.core.server;
Lines 352-370 Link Here
352
	 */
353
	 */
353
	public void removeSenderWith(Socket socket)
354
	public void removeSenderWith(Socket socket)
354
	{
355
	{
355
		synchronized (_senders){
356
		for (int i = 0; i < _senders.size(); i++)
356
			for (int i = 0; i < _senders.size(); i++)
357
		{
358
			Sender sender = (Sender) _senders.get(i);
359
			if (sender.socket() == socket)
357
			{
360
			{
358
				Sender sender = (Sender) _senders.get(i);
361
				// sender sends last ack before death
359
				if (sender.socket() == socket)
362
				DataElement document = _dataStore.createObject(null, DataStoreResources.DOCUMENT_TYPE, "exit", "exit"); //$NON-NLS-1$ //$NON-NLS-2$
360
				{
363
				sender.sendDocument(document, 2);
361
					// sender sends last ack before death
364
				removeSender(sender);
362
					DataElement document = _dataStore.createObject(null, DataStoreResources.DOCUMENT_TYPE, "exit", "exit"); //$NON-NLS-1$ //$NON-NLS-2$
363
					sender.sendDocument(document, 2);
364
					removeSender(sender);
365
				}
366
			}
365
			}
367
		}
366
		}		
368
	}
367
	}
369
	
368
	
370
	/**
369
	/**

Return to bug 404082