home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ool.zip / OOL / include / xthread.h < prev    next >
Text File  |  1997-04-05  |  1KB  |  42 lines

  1. #ifndef __OOL_XTHREAD_H__
  2. #define __OOL_XTHREAD_H__
  3.  
  4. /*===========================================================================*/
  5. /* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
  6. /*===========================================================================*/
  7. /*                              class: XThread                               */
  8. /*                       derived from: XProcess                              */
  9. /*                        last update: 2/97                                  */
  10. /*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
  11. /*===========================================================================*/
  12.  
  13. #include "xprocess.h"
  14.  
  15.  
  16. class _export_ XThread: public XProcess
  17. {
  18.       #ifndef __WATCOMC__
  19.       friend void _Optlink StartUp(void * v);
  20.       #else
  21.       friend void StartUp( void* v );
  22.       #endif
  23.    private:
  24.         TID tid;
  25.       LONG stackSize;
  26.       #ifndef __WATCOMC__
  27.       static int threadsRunning;
  28.       #endif
  29.       void ThreadEntry( void );
  30.    public:
  31.       void Run();
  32.       virtual void Init( void ) { ;}
  33.       static void RunThreads( void );
  34.       XThread( const LONG stack = 128000 ) { stackSize = stack; }
  35.         ULONG Resume();
  36.         ULONG Suspend();
  37.       virtual void Terminate( void );
  38. };
  39.  
  40.  
  41. #endif
  42.