From: Sasa M. <sa...@us...> - 2004-05-31 08:01:58
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8988/org/jrobin/core Modified Files: RrdNioBackend.java Log Message: Minor changes in NIO, fixed single javadoc error in RrdGraphDef class Index: RrdNioBackend.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdNioBackend.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RrdNioBackend.java 30 May 2004 10:06:48 -0000 1.3 --- RrdNioBackend.java 31 May 2004 08:01:46 -0000 1.4 *************** *** 37,44 **** */ public class RrdNioBackend extends RrdFileBackend { private int syncMode; MappedByteBuffer byteBuffer; ! ! private Timer syncTimer; RrdNioBackend(String path, boolean readOnly, int lockMode, int syncMode, int syncPeriod) --- 37,45 ---- */ public class RrdNioBackend extends RrdFileBackend { + private static final Timer syncTimer = new Timer(true); + private int syncMode; MappedByteBuffer byteBuffer; ! private TimerTask syncTask; RrdNioBackend(String path, boolean readOnly, int lockMode, int syncMode, int syncPeriod) *************** *** 55,64 **** private void createSyncTask(int syncPeriod) { ! TimerTask syncTask = new TimerTask() { public void run() { sync(); } }; - syncTimer = new Timer(true); syncTimer.schedule(syncTask, syncPeriod * 1000L, syncPeriod * 1000L); } --- 56,64 ---- private void createSyncTask(int syncPeriod) { ! syncTask = new TimerTask() { public void run() { sync(); } }; syncTimer.schedule(syncTask, syncPeriod * 1000L, syncPeriod * 1000L); } *************** *** 104,109 **** */ public void close() throws IOException { ! if(syncTimer != null) { ! syncTimer.cancel(); } super.close(); // calls sync() --- 104,109 ---- */ public void close() throws IOException { ! if(syncTask != null) { ! syncTask.cancel(); } super.close(); // calls sync() |