1.1 --- a/src/core/system-thread.h Tue Nov 10 06:14:11 2009 -0800
1.2 +++ b/src/core/system-thread.h Tue Nov 10 11:03:04 2009 -0800
1.3 @@ -72,12 +72,20 @@
1.4 * is asking the SystemThread to call object->MyMethod () in a new thread
1.5 * of execution.
1.6 *
1.7 - * Remember that if you are invoking a callback on an object that is
1.8 - * managed by a smart pointer, you need to call PeekPointer.
1.9 + * If starting a thread in your currently executing object, you can use the
1.10 + * "this" pointer:
1.11 + *
1.12 + * Ptr<SystemThread> st = Create<SystemThread> (
1.13 + * MakeCallback (&MyClass::MyMethod, this));
1.14 + * st->Start ();
1.15 + *
1.16 + * Object lifetime is always an issue with threads, so it is common to use
1.17 + * smart pointers. If you are spinning up a thread in an object that is
1.18 + * managed by a smart pointer, you can use that pointer directly:
1.19 *
1.20 * Ptr<MyClass> myPtr = Create<MyClass> ();
1.21 * Ptr<SystemThread> st = Create<SystemThread> (
1.22 - * MakeCallback (&MyClass::MyMethod, PeekPointer (myPtr)));
1.23 + * MakeCallback (&MyClass::MyMethod, myPtr));
1.24 * st->Start ();
1.25 *
1.26 * Just like any thread, you can synchronize with its termination. The