- static thread detach(const function& function)
- {
- thread::function* fcopy = new thread::function(function);
- SDL_Thread* thread = SDL_CreateThread(&thread::run, (void*)fcopy);
- if (thread == 0) delete fcopy;
- return moof::thread(thread);
- }
+ static thread detach(const function& function);
+
+ /**
+ * Detach a new thread and run its runloop with an initial timer.
+ * \param timer The timer to schedule on the thread.
+ * \return The new thread, or an invalid thread if an error occurred.
+ */
+ static thread detach(timer& timer);