summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-03-21Ensure JavaTimer.stop() cleans up any unresolved eventsAlex Clayton
The code for stop() in JavaTimer read: @Override public void stop() { timer_.stop(); //FIXME: This needs to clear any remaining events out of the EventLoop queue. } Where as the equivalent swiften code in BoostTimer was: void BoostTimer::stop() { { std::unique_lock<std::mutex> lockTimer(timerMutex); shuttingDown = true; timer->cancel(); eventLoop->removeEventsFromOwner(shared_from_this()); } } This patch updates the java code to bring it inline with the swiften code. In short to make sure it removes any remaining events from the event loop when it is stopped. Test-information: Code Inspection. Unit test still pass. Ran update stroke against M-Link Console it ran ok. Change-Id: Idf92e92d002b8404547702d1c34738165e331810
2012-01-16Update JavaTimer class to guard against premature timer expirationNick Hudson
The JavaTimer class uses Thead.sleep() to wait a specified number of milliseconds. Thread.sleep() requires the caller catch InterruptedException, but in the original implementation, such an exception would result in the code assuming that the specified time had been reached. So as things stood, if you e.g. set a timer for 60 seconds, then the timer might generate its "onTick" signal before that 60 seconds had elapsed. This patch changes the code so that the method will wait until the specified time has been reached. The "milliseconds" parameters are also changed to "long", which is the type used by the rest of the java library for millisecond values. Added a bit of javadoc and a toString() method as well. Note there is still a "FIXME" in the code which I've not addressed. Test-information: Tested in debugging setup; things seem to be working as expected.
2011-10-31Fix utf-8 encoding on Remko's name throughout. Now compiles with Java 7Kevin Smith
2011-07-01Initial importKevin Smith