foundation: Refactored TimeSync class.
- Allow to disable the local clock renewal by setting localClockRenew to 0. The local renewal mechanism was an optimization which regularly retrieved the latest time (by default every 50 ms) from the system. This should reduce the number of syscalls to retrieve the current time since the maximum interval was enforced to the local clock renewal interval. However, this approach has the drawback that the thread responsible for the clock retrieval might not get scheduled by the operating system in time. In that case, outdated times may be returned. This was worsened by the fact that the same thread is responsible for retrieving the current time from the DIR. If this operation blocks, the current local time may be outdated, too. Therefore, future versions will disable this mechanism and every call getLocalSystemTime() and getGlobalTime() will retrieve the latest time from the system directly. - Allow to disable remote time synchronization against the DIR by setting the interval to 0. - - Removed parameter int timeSyncInterval from initializeLocal() since it was not used. - Removed unused enableRemoteSynchronization(). - Removed static modifier from close() since this lead to race conditions: when close() was called, it competed with run() for the value of "theInstance" which was set to null after run() finished. This lead to NullPointerExceptions e.g., in xtfs_scrub or xtfs_chstatus. - Removed unused main() code. git-svn-id: https://xtreemfs.googlecode.com/svn/trunk@3442 f8528748-c2c0-11dd-ba5c-d3b7c2b3b534
Loading
Please sign in to comment