From f8fd3e94111d164bf7d3ac88c10a1069d2e7e83a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 28 Aug 2012 18:08:19 +0000 Subject: Made a function that should be private private, and documented yield. Also, tested everything just to be safe :). --- src/stable/thread.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/stable/thread.h b/src/stable/thread.h index f0456f3..920807b 100644 --- a/src/stable/thread.h +++ b/src/stable/thread.h @@ -102,15 +102,23 @@ namespace Bu /** * The workhorse of the Thread class. This is the function that will * run in the thread, when this function exits the thread dies and is - * cleaned up by the system. Make sure to read up on ThreadMutex, - * ThreadCondition, and cancel to see how to control and protect - * everything you do in a safe way within this function. + * cleaned up by the system. Make sure to read up on Bu::Mutex, + * Bu::Condition, and the Bu::Synchro* classes to see how to control + * and protect everything you do in a safe way within this function. *@returns I'm not sure right now, but this is the posix standard form. */ virtual void run()=0; /** - * This is the hidden-heard of the thread system. While run is what the + * Gives up some cpu-time in the currently running thread. If a thread + * is working hard, but you want to give other threads on the system + * some time to do some work, call yield. + */ + void yield(); + + private: + /** + * This is the hidden-heart of the thread system. While run is what the * user gets to override, and everything said about it is true, this is * the function that actually makes up the thread, it simply calls the * run member function in an OO-friendly way. This is what allows us to @@ -119,8 +127,6 @@ namespace Bu *@returns This is specified by posix, I'm not sure yet. */ static void *threadRunner( void *pThread ); - - void yield(); }; } -- cgit v1.2.3