View | Details | Raw Unified | Return to bug 307282 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/jobs/OrderedLock.java (-13 / +18 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2009 IBM Corporation and others.
2
 * Copyright (c) 2003, 2010 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 7-12 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM - Initial API and implementation
9
 *     IBM - Initial API and implementation
10
 *     James Blackburn (Broadcom Corp.) - Bug 307282 #acquire(int) breaks lock after interrupt() 
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.core.internal.jobs;
12
package org.eclipse.core.internal.jobs;
12
13
Lines 102-112 Link Here
102
			return true;
103
			return true;
103
		if (DEBUG)
104
		if (DEBUG)
104
			System.out.println("[" + Thread.currentThread() + "] Operation waiting to be executed... " + this); //$NON-NLS-1$ //$NON-NLS-2$
105
			System.out.println("[" + Thread.currentThread() + "] Operation waiting to be executed... " + this); //$NON-NLS-1$ //$NON-NLS-2$
105
		success = doAcquire(semaphore, delay);
106
		try {
106
		manager.resumeSuspendedLocks(Thread.currentThread());
107
			success = doAcquire(semaphore, delay);
107
		if (DEBUG)
108
		} finally {
108
			System.out.println("[" + Thread.currentThread() + //$NON-NLS-1$
109
			manager.resumeSuspendedLocks(Thread.currentThread());
109
					(success ? "] Operation started... " : "] Operation timed out... ") + this); //$NON-NLS-1$ //$NON-NLS-2$ //}
110
			if (DEBUG)
111
				System.out.println("[" + Thread.currentThread() + //$NON-NLS-1$
112
						(success ? "] Operation started... " : "] Operation timed out... ") + this); //$NON-NLS-1$ //$NON-NLS-2$
113
		}
110
		return success;
114
		return success;
111
	}
115
	}
112
116
Lines 170-182 Link Here
170
			if (DEBUG)
174
			if (DEBUG)
171
				System.out.println("[" + Thread.currentThread() + "] Operation interrupted while waiting... :-|"); //$NON-NLS-1$ //$NON-NLS-2$
175
				System.out.println("[" + Thread.currentThread() + "] Operation interrupted while waiting... :-|"); //$NON-NLS-1$ //$NON-NLS-2$
172
			throw e;
176
			throw e;
173
		}
177
		} finally {
174
		if (success) {
178
			if (success) {
175
			depth++;
179
				depth++;
176
			updateCurrentOperation();
180
				updateCurrentOperation();
177
		} else {
181
			} else {
178
			removeFromQueue(semaphore);
182
				removeFromQueue(semaphore);
179
			manager.removeLockWaitThread(Thread.currentThread(), this);
183
				manager.removeLockWaitThread(Thread.currentThread(), this);
184
			}
180
		}
185
		}
181
		return success;
186
		return success;
182
	}
187
	}

Return to bug 307282