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.
|
|
//+---------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (C) Microsoft Corporation, 1992 - 1995.
//
// File: PQueue.cxx
//
// Purpose: 'Pending' queue. Queue of pending notifications.
//
// Classes: CPendingQueue
//
// History: 30-Aug-95 KyleP Created
//
//----------------------------------------------------------------------------
#pragma once
//+---------------------------------------------------------------------------
//
// Class: CPendingQueue
//
// Purpose: Queue of pending notifications
//
// History: 30-Aug-95 KyleP Created.
//
//----------------------------------------------------------------------------
class CPendingQueue { public:
//
// Construction and destruction
//
CPendingQueue();
~CPendingQueue();
//
// Queue operations
//
unsigned LokPrepare( WORKID wid );
BOOL LokComplete( unsigned iHint, WORKID wid, USN usn, VOLUMEID volumeId, PARTITIONID partid, ULONG action );
BOOL LokRemove( WORKID & wid, USN & usn, VOLUMEID& volumeId, PARTITIONID & partid, ULONG & action );
unsigned LokCountCompleted();
void LokGetCompleted( WORKID * awid );
CMutexSem& GetMutex () { return _mutex; }
void LokFlushCompletedEntries();
void LokFlushAllEntries();
private:
class CDocItem { public:
USN usn; VOLUMEID volumeId; WORKID wid; PARTITIONID partid; ULONG action; unsigned hint; BOOL fComplete; };
unsigned _cUnique; // Unique cookie
unsigned _iBottom; // Bottom of queue. Used to optimize ::Remove
unsigned _iTop; // First free element at top of queue.
unsigned _cDoc; // Size of queue
CDocItem * _aDoc; // Queue itself.
CMutexSem _mutex; // It gets it's own lock.
};
|