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.

83 lines
1.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1993.
  5. //
  6. // File: procssr.hxx
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions: None.
  13. //
  14. // History: 25-Oct-95 MarkBl Created
  15. //
  16. //----------------------------------------------------------------------------
  17. #ifndef __PRCSSR_HXX__
  18. #define __PRCSSR_HXX__
  19. // A success return from SubmitJobs() that is different from S_OK and S_FALSE
  20. #define S_SCHED_JOBS_ACCEPTED ((HRESULT)0x00000002L)
  21. //+---------------------------------------------------------------------------
  22. //
  23. // Class: CJobProcessor
  24. //
  25. // Synopsis:
  26. //
  27. // History: 25-Oct-95 MarkBl Created
  28. //
  29. // Notes: None.
  30. //
  31. //----------------------------------------------------------------------------
  32. class CJobProcessor : public CDLink,
  33. public CTask
  34. {
  35. public:
  36. CJobProcessor(void) : _rgHandles(NULL) {
  37. TRACE3(CJobProcessor, CJobProcessor);
  38. InitializeCriticalSection(&_csProcessorCritSection);
  39. }
  40. ~CJobProcessor();
  41. HRESULT Initialize(void);
  42. BOOL IsIdle(void);
  43. CJobProcessor * Next(void);
  44. CJobProcessor * Prev(void);
  45. void PerformTask(void);
  46. void KillJob(LPTSTR ptszJobName);
  47. void KillIfFlagSet(DWORD dwFlag);
  48. HRESULT SubmitJobs(CRunList * pRunList);
  49. void Shutdown(void);
  50. private:
  51. void _EmptyJobQueue(CJobQueue & JobQueue, DWORD dwMsgId = 0);
  52. void _ProcessRequests(void);
  53. void _Shutdown(void);
  54. CRITICAL_SECTION _csProcessorCritSection;
  55. CJobQueue _RequestQueue;
  56. CJobQueue _ProcessingQueue;
  57. HANDLE * _rgHandles;
  58. };
  59. #endif // __PRCSSR_HXX__