Description: Achieved through the Mutex package to read and write locks. Priority read lock to write lock. If write lock is waiting, the time lock has to wait until the write lock for the lock, and release to get. Read lock is a shared lock, write lock is an exclusive lock. Mutex and critical section provides two ways to achieve macro switch, Mutex object for the system kernel, the speed is slower, but better control. Speed critical areas, without access to critical areas without timeout, time-control inaccurate. BOOL ReadLock (int timeout = INFINITE) BOOL TryReadLock (int timeout = INFINITE, BOOL bLock = TRUE) BOOL ReadUnLock (int timeout = INFINITE) BOOL WriteLock (int timeout = INFINITE) BOOL TryWriteLock (int timeout = INFINITE, BOOL bLock = TRUE) BOOL WriteUnLock (int timeout = INFINITE) BOOL WriteToRead (int timeout = INFINITE) BOOL ReadToWrite (int timeout = INFINITE)
To Search:
File list (Check if you may need any files):
res\SimuRWLock.ico
...\SimuRWLock.rc2
ReadMe.txt
Resource.h
RWLock.cpp
RWLock.h
SimuRWLock.aps
SimuRWLock.clw
SimuRWLock.cpp
SimuRWLock.dsp
SimuRWLock.dsw
SimuRWLock.h
SimuRWLock.ncb
SimuRWLock.opt
SimuRWLock.plg
SimuRWLock.rc
SimuRWLockDlg.cpp
SimuRWLockDlg.h
StdAfx.cpp
StdAfx.h
res