Ignore:
Timestamp:
2013-04-07T17:07:27+02:00 (13 years ago)
Author:
akks
Message:

JOSM/ImageryCache: updated MapDB (no more deadlocks, Java 1.6 compatible), less crashes, multiple-JOSM support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java

    r29363 r29484  
    378378        }
    379379    }
     380   
     381   
     382    /** Engine wrapper with all methods synchronized on global lock, useful to diagnose concurrency issues.*/
     383    public static class SynchronizedEngineWrapper extends EngineWrapper{
     384
     385        protected SynchronizedEngineWrapper(Engine engine) {
     386            super(engine);
     387        }
     388
     389        @Override
     390        synchronized public <A> long put(A value, Serializer<A> serializer) {
     391            return super.put(value, serializer);
     392        }
     393
     394        @Override
     395        synchronized public <A> A get(long recid, Serializer<A> serializer) {
     396            return super.get(recid, serializer);
     397        }
     398
     399        @Override
     400        synchronized public <A> void update(long recid, A value, Serializer<A> serializer) {
     401            super.update(recid, value, serializer);
     402        }
     403
     404        @Override
     405        synchronized public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) {
     406            return super.compareAndSwap(recid, expectedOldValue, newValue, serializer);
     407        }
     408
     409        @Override
     410        synchronized public <A> void delete(long recid, Serializer<A> serializer) {
     411            super.delete(recid, serializer);
     412        }
     413
     414        @Override
     415        synchronized public void close() {
     416            super.close();
     417        }
     418
     419        @Override
     420        synchronized public boolean isClosed() {
     421            return super.isClosed();
     422        }
     423
     424        @Override
     425        synchronized public void commit() {
     426            super.commit();
     427        }
     428
     429        @Override
     430        synchronized public void rollback() {
     431            super.rollback();
     432        }
     433
     434        @Override
     435        synchronized public boolean isReadOnly() {
     436            return super.isReadOnly();
     437        }
     438
     439        @Override
     440        synchronized public void compact() {
     441            super.compact();
     442        }
     443    }
    380444
    381445}
Note: See TracChangeset for help on using the changeset viewer.