Also, realized that there was potential for a runaway task if two threads
called schedule() and cancel() simultaneously and the planets are aligned.
Cancel any de-fanged task in case it is a runaway.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1570 6335cc39-0255-0410-8fd6-9bcaacd3b74c
the part about volatile variables, and that led me to this simpler
implementation.
Interval is no longer Runnable (good because it won't tempt people to post
the interval themselves), and I got rid of the less-than-sweet _fired
and _expired variables. The trade off? schedule() and cancel() are
synchronized, not a big deal, and the task needs to check if it is
being run on the dispatch thread, which shouldn't be a big deal.
The major plus is that the code is easier to understand.
The same amount of objects are created, and we don't do anything silly
like create a new object every time the interval fires.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1556 6335cc39-0255-0410-8fd6-9bcaacd3b74c
There may be chapter 17 issues, but I'm fairly certain that if there are we can iron those out without changing the API.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1554 6335cc39-0255-0410-8fd6-9bcaacd3b74c
RunQueue is now an interface that is very simple- it serially runs Runnables.
Removed Invoker.ResultReceiver, the invoker now takes a RunQueue.
The method to post a Runnable to RunQueue is called postRunnable(), rather
than the legacy postUnit(). postUnit() is the method name of the Invoker
to post Invoker.Unit objects, and I just figured it was better to keep those
distinct, since an Invoker.Unit is also a Runnable, it could be very easy
to post an Invoker.Unit to the wrong thing if not careful.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1553 6335cc39-0255-0410-8fd6-9bcaacd3b74c
entirely from old-and-busted crypt() to the new hotness MD5. This allows
us to interoperate cleanly with our soon-to-be new forum system which MD5
encodes a user's password before it ever leaves the web browser. Those
security conscious little devils.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1551 6335cc39-0255-0410-8fd6-9bcaacd3b74c
of the stretchy components was computed as the maximum size of all
the components, even the fixed ones, and they already have their size
accounted for.
Changed to also track the maximum size of the free components and use that
instead.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1549 6335cc39-0255-0410-8fd6-9bcaacd3b74c
easily in java 1.5 by using a ThreadPoolExecutor with 1 thread in the
pool and a special queue implementation that merged like entries,
but we want this special functionality now.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1538 6335cc39-0255-0410-8fd6-9bcaacd3b74c
within a tool in a sensible manner (loading templates from the classpath,
not logging boatloads of informational messages, not complaining about a
non-existent "macro library").
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1530 6335cc39-0255-0410-8fd6-9bcaacd3b74c
inefficiency in that if the first record in a chain did not match it ended
up checking it once more prior to moving on to the next record in the chain.
Cleaned up to be similar to HashIntMap's remove implementation.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1527 6335cc39-0255-0410-8fd6-9bcaacd3b74c
- Renamed the methods for manipulating specific elements of the list
of objects being edited to have the suffix "Datum" instead of "Data".
- Added addDatum() and another version of removeDatum().
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1526 6335cc39-0255-0410-8fd6-9bcaacd3b74c
elements in the list. I do this because null elements are incompatible
with the implementation details of these utility methods. There were only
two related pieces of code in all our projects that used the behavior
of indexOf(null) and those now use the new indexOfNull() method.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1522 6335cc39-0255-0410-8fd6-9bcaacd3b74c