Source code of Windows XP (NT5)
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.

42 lines
1.4 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: WorkItem.h
  3. //
  4. // Copyright (c) 1999-2000, Microsoft Corporation
  5. //
  6. // Class that implements the handling of queuing a work item and calling the
  7. // entry point of the work item function when entered in a worker thread.
  8. //
  9. // History: 1999-11-26 vtan created
  10. // 2000-08-25 vtan moved from Neptune to Whistler
  11. // --------------------------------------------------------------------------
  12. #ifndef _WorkItem_
  13. #define _WorkItem_
  14. #include "CountedObject.h"
  15. // --------------------------------------------------------------------------
  16. // CWorkItem
  17. //
  18. // Purpose: A class to hide the work of queuing a work item to a worker
  19. // thread for execution.
  20. //
  21. // History: 1999-11-26 vtan created
  22. // 2000-08-25 vtan moved from Neptune to Whistler
  23. // --------------------------------------------------------------------------
  24. class CWorkItem : public CCountedObject
  25. {
  26. public:
  27. CWorkItem (void);
  28. virtual ~CWorkItem (void);
  29. NTSTATUS Queue (void);
  30. protected:
  31. virtual void Entry (void) = 0;
  32. private:
  33. static DWORD WINAPI WorkItemEntryProc (void *pParameter);
  34. };
  35. #endif /* _WorkItem_ */