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.
 
 
 
 
 
 

45 lines
775 B

////////////////////////////////////////////////
// Atomics.h
#ifndef __ATOMICS_H__
#define __ATOMICS_H__
void AtomicInit();
void AtomicTerm();
// Returns true if val at zero and siezed
bool AtomicSeizeToken( long &lVal );
// Returns true if val at non-zero and released
bool AtomicReleaseToken( long &lVal );
class CAtomicList
{
public:
typedef enum tag_ListAccess_t
{
LIST_READ,
LIST_WRITE,
} ListAccess;
// Construction
public:
CAtomicList();
~CAtomicList();
// Members
protected:
long m_lCount;
DWORD m_dwThreadID;
CRITICAL_SECTION m_crit;
HANDLE m_hEvent;
// Implemetation
public:
bool Lock( short nType, DWORD dwTimeOut = INFINITE );
void Unlock( short nType );
};
#endif // __ATOMICS_H__