Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.0 KiB

  1. /*
  2. *
  3. * REVISIONS:
  4. * ane12Jan93: made Threadable an updateable object
  5. * rct22Apr93: added new Start() method, added return types
  6. * cad09Jul93: using new semaphores
  7. *
  8. */
  9. #ifndef __THREAD_H
  10. #define __THREAD_H
  11. #if (C_OS & C_NT)
  12. #include <windows.h>
  13. #endif
  14. #include "thrdable.h"
  15. _CLASSDEF(Thread)
  16. class Thread {
  17. private:
  18. PThreadable theObject;
  19. #if (C_OS & C_NT)
  20. HANDLE theThreadHandle;
  21. #endif
  22. public:
  23. Thread(PThreadable object) : theObject (object) {};
  24. virtual ~Thread();
  25. INT Start(); // Start thread with parent's context
  26. INT Start(INT notUsed); // Start thread with it's own context
  27. VOID RunMain();
  28. INT Wait() { return theObject->Wait(); };
  29. INT Release() { return theObject->Release(); };
  30. INT Exit() { return theObject->Exit(); };
  31. INT ExitWait() { return theObject->ExitWait(); };
  32. INT Reset() { return theObject->Reset(); };
  33. PThreadable GetThreadableObject();
  34. #if (C_OS & C_NT)
  35. VOID TerminateThreadNow();
  36. #endif
  37. };
  38. #endif