scala/scala — pull request #713 by havocp (2012-06-13 23:12:24+00:00)
Title: Fixups to Future task stack

This fixes a bug where _taskStack could batch a task
into the wrong executor, as previously commented in the
code.

It now uses the _taskStack machinery for the Future.apply
dispatch in addition to callback dispatch, so we can batch
Future(body) as well.

Less significantly, it micro-optimizes by combining some
different closures and Runnable into a Task object, so
there aren't as many objects created when storing and
dispatching a callback. So it saves a bit of memory
and runtime perhaps.

Review by @axel22