MCPcopy Create free account
hub / github.com/badvision/jace / triggerDiskUpdate

Method triggerDiskUpdate

src/main/java/jace/hardware/DiskIIDrive.java:219–235  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

217 }
218
219 private void triggerDiskUpdate() {
220 lastWriteTime = System.currentTimeMillis();
221 if (writerThread == null || !writerThread.isAlive()) {
222 writerThread = new Thread(() -> {
223 long diff;
224 // Wait until there have been no virtual writes for specified delay time
225 while ((diff = System.currentTimeMillis() - lastWriteTime) < WRITE_UPDATE_DELAY) {
226 // Sleep for difference of time
227 LockSupport.parkNanos(diff * 1000);
228 // Note: In the meantime, there could have been another disk write,
229 // in which case this loop will repeat again as needed.
230 }
231 updateDisk();
232 });
233 writerThread.start();
234 }
235 }
236
237 void insertDisk(File diskPath) throws IOException {
238 if (DEBUG) {

Callers 1

writeMethod · 0.95

Calls 3

updateDiskMethod · 0.95
isAliveMethod · 0.80
startMethod · 0.80

Tested by

no test coverage detected