Dépôt officiel du code source de l'ERP OpenConcerto
/trunk/OpenConcerto/src/org/openconcerto/utils/cache/ICacheSupport.java |
---|
107,6 → 107,7 |
} |
} |
boolean interrupted = false; |
if (didDie) { |
// only CacheTimeOut are in our executor (plus the runnable for trimWatchers()) |
// and all items in a cache (even the running ones) have a timeout (but they don't all |
118,6 → 119,15 |
} |
} |
// make sure that the currently executing runnable is done before checking |
while (true) { |
try { |
if (this.getTimer().awaitTermination(1, TimeUnit.SECONDS)) |
break; |
} catch (InterruptedException e) { |
interrupted = true; |
} |
} |
synchronized (this) { |
purgeWatchers(); |
assert this.watchers.isEmpty() : this.watchers.size() + " item(s) were not removed : " + this.watchers.values(); |
124,6 → 134,8 |
} |
} |
if (interrupted) |
Thread.currentThread().interrupt(); |
return didDie; |
} |