home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1998 / MacHack 1998.toast / Papers / C++ Exceptions / µShell / Threads Support / ThreadContext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-05-25  |  750 b   |  43 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        Thread.h
  3.  
  4.     Contains:    An abstract class for threads
  5.                 
  6.     Written by: Steve Sisak
  7.     
  8.     Copyright:    © 1995 by Steve Sisak, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.      
  12.  */
  13. #ifndef    __THREADCONTEXT__
  14. #define    __THREADCONTEXT__
  15.  
  16. #include "LinkedListOfObject.h"
  17.  
  18. class TThread;
  19.  
  20. class ThreadContext : private ListLink
  21. {
  22. protected:
  23.     TThread*        fThread;
  24.  
  25. public:
  26.     ThreadContext();
  27.     ThreadContext(TThread& aThread);
  28.     virtual ~ThreadContext();    
  29.  
  30.     virtual void SwitchIn(void);
  31.     virtual void SwitchOut(void);
  32.     virtual void Terminate(void);
  33.     
  34.     // Need to ask MW how to call destructors if thread is terminated
  35.  
  36. private: // required overrides for TListLink 
  37.     LinkedList*        GetList();
  38.     void*            GetObjectPtr();
  39. };
  40.  
  41.  
  42. #endif // __THREADCONTEXT__
  43.