Permalink
Browse files

Use volatile to ensure concurrent threads use up to date property value

  • Loading branch information...
luccioman committed Jun 15, 2017
1 parent 28b451a commit 5fdd5d16b1ae40e596c57ebe737f990f16a3fd52
Showing with 3 additions and 3 deletions.
  1. +3 −3 source/net/yacy/kelondro/blob/Compressor.java
@@ -60,19 +60,19 @@
private TreeMap<byte[], byte[]> buffer;
/** Total size (in bytes) of uncompressed entries in buffer */
private long bufferlength;
private volatile long bufferlength;
/** Maximum {@link #bufferlength} value before compressing and flushing to the backend */
private final long maxbufferlength;
/** Maximum time (in milliseconds) to acquire a synchronization lock on get() and insert() */
private long lockTimeout;
private volatile long lockTimeout;
/** Synchronization lock */
private final ReentrantLock lock;
/** The compression level */
private int compressionLevel;
private volatile int compressionLevel;
/**
* @param backend the backend storage

0 comments on commit 5fdd5d1

Please sign in to comment.