Enqueuing Work on a Thread Pool
You use the enqueue() member to enqueue work that is in a function enclosed in an RWTFunctor<void()> object. You may enqueue a variety of different work functions in the same thread pool but each new work function must be encapsulated in an RWTFunctor<void()> object. Work functors can be enqueued only between the construction of the thread pool and a call to stop(). Any attempt to enqueue work after stop() produces an exception.
It is important to note that all work functors must be valid; that is, RWTFunctor<void()>::isValid() must return true.
All exceptions that might be thrown within the functor must be handled within the functor.
Invalid functors, and exceptions thrown by functors but not caught within the same functor, will be ignored in the release version of the compiled source code. During initial development, therefore, you should compile source code in debug mode, which will throw assertions when invalid functors are found or uncaught exceptions are thrown.