mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-25 01:45:33 +02:00
Report long wait for exclusive index access to the user.
Change-Id: I27b69a7be19060ec2874aff92d86420c32ee595f
This commit is contained in:
parent
9622166291
commit
64e7137959
3 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,7 @@ import org.eclipse.osgi.util.NLS;
|
|||
|
||||
public class Messages extends NLS {
|
||||
public static String Checksums_taskComputeChecksums;
|
||||
public static String PDOM_waitingForWriteLock;
|
||||
public static String PDOMImportTask_errorInvalidArchive;
|
||||
public static String PDOMImportTask_errorInvalidPDOMVersion;
|
||||
public static String PDOMManager_ClosePDOMJob;
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
# Markus Schorn (Wind River Systems)
|
||||
###############################################################################
|
||||
Checksums_taskComputeChecksums=Computing checksums
|
||||
PDOM_waitingForWriteLock=Waiting for exclusive index access
|
||||
PDOMImportTask_errorInvalidArchive=Invalid Archive: {0}
|
||||
PDOMImportTask_errorInvalidPDOMVersion=The version of the {0} to import for project {1} does not match
|
||||
PDOMManager_notifyJob_label=Notify Index Change Listeners
|
||||
|
|
|
@ -1043,11 +1043,16 @@ public class PDOM extends PlatformObject implements IPDOM {
|
|||
|
||||
// Let the readers go first
|
||||
long start= sDEBUG_LOCKS ? System.currentTimeMillis() : 0;
|
||||
int count = 0;
|
||||
while (lockCount > giveupReadLocks || waitingReaders > 0) {
|
||||
mutex.wait(CANCELLATION_CHECK_INTERVAL);
|
||||
if (monitor != null && monitor.isCanceled()) {
|
||||
throw new OperationCanceledException();
|
||||
}
|
||||
count++;
|
||||
if (monitor != null && count == LONG_WRITE_LOCK_REPORT_THRESHOLD / CANCELLATION_CHECK_INTERVAL) {
|
||||
monitor.subTask(Messages.PDOM_waitingForWriteLock);
|
||||
}
|
||||
if (sDEBUG_LOCKS) {
|
||||
start = reportBlockedWriteLock(start, giveupReadLocks);
|
||||
}
|
||||
|
@ -1057,6 +1062,8 @@ public class PDOM extends PlatformObject implements IPDOM {
|
|||
timeWriteLockAcquired = System.currentTimeMillis();
|
||||
db.setExclusiveLock();
|
||||
}
|
||||
if (monitor != null)
|
||||
monitor.subTask(""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
final public void releaseWriteLock() {
|
||||
|
|
Loading…
Add table
Reference in a new issue