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.

82 lines
1.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: PQueue.cxx
  7. //
  8. // Purpose: 'Pending' queue. Queue of pending notifications.
  9. //
  10. // Classes: CPendingQueue
  11. //
  12. // History: 30-Aug-95 KyleP Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. //+---------------------------------------------------------------------------
  17. //
  18. // Class: CPendingQueue
  19. //
  20. // Purpose: Queue of pending notifications
  21. //
  22. // History: 30-Aug-95 KyleP Created.
  23. //
  24. //----------------------------------------------------------------------------
  25. class CPendingQueue
  26. {
  27. public:
  28. //
  29. // Construction and destruction
  30. //
  31. CPendingQueue();
  32. ~CPendingQueue();
  33. //
  34. // Queue operations
  35. //
  36. unsigned LokPrepare( WORKID wid );
  37. BOOL LokComplete( unsigned iHint, WORKID wid, USN usn, VOLUMEID volumeId, PARTITIONID partid, ULONG action );
  38. BOOL LokRemove( WORKID & wid, USN & usn, VOLUMEID& volumeId, PARTITIONID & partid, ULONG & action );
  39. unsigned LokCountCompleted();
  40. void LokGetCompleted( WORKID * awid );
  41. CMutexSem& GetMutex () { return _mutex; }
  42. void LokFlushCompletedEntries();
  43. void LokFlushAllEntries();
  44. private:
  45. class CDocItem
  46. {
  47. public:
  48. USN usn;
  49. VOLUMEID volumeId;
  50. WORKID wid;
  51. PARTITIONID partid;
  52. ULONG action;
  53. unsigned hint;
  54. BOOL fComplete;
  55. };
  56. unsigned _cUnique; // Unique cookie
  57. unsigned _iBottom; // Bottom of queue. Used to optimize ::Remove
  58. unsigned _iTop; // First free element at top of queue.
  59. unsigned _cDoc; // Size of queue
  60. CDocItem * _aDoc; // Queue itself.
  61. CMutexSem _mutex; // It gets it's own lock.
  62. };