home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dho.zip / DHO / SRC / THREAD.H < prev    next >
C/C++ Source or Header  |  1995-08-27  |  930b  |  45 lines

  1. /****************************************/
  2. /*    Developer Helper Object Set       */
  3. /*  (C) 1994-95 Thomas E. Bednarz, Jr.  */
  4. /*     All rights reserved              */
  5. /***************************************/
  6.  
  7. /* $Id: thread.h 1.2 1995/08/13 03:21:12 teb Exp $ */
  8.  
  9.  
  10. #ifndef __THREAD_H__
  11. #define __THREAD_H__
  12.  
  13. #define INCL_DOSPROCESS
  14. #include<os2.h>
  15.  
  16. #include<object.h>
  17.  
  18. #define DEFAULT_STACK_SIZE 4096
  19.  
  20.  
  21.  
  22. class TThread : public TObject
  23. {
  24.       TID threadId;
  25.       ULONG fStackSize, fThreadArg;
  26.       PFNTHREAD threadFunc;
  27.  
  28.    public:
  29.       TThread(PFNTHREAD func, ULONG args, ULONG stackSize);
  30.       virtual ~TThread();
  31.       virtual BOOL init(BOOL active);
  32.       BOOL setPriority(ULONG delta);
  33.       void suspend();
  34.       void resume();
  35.       void enterCritical();
  36.       void exitCritical();
  37.       void exitThread();
  38.       void waitThread();
  39.  
  40.       TID inqThreadId();
  41. };
  42.  
  43.  
  44. #endif
  45.