文件名称:SimuRWLock
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:28.75kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
通过Mutex封装实现的读写锁类。写锁优先于读锁。如果有写锁在等待,则读锁一直等待,直到写锁获取锁,并释放后才能获取。读锁是共享锁,写锁是独占锁。提供Mutex与临界区两种方式可宏切换实现,Mutex为系统内核对象,速度比较慢,但比较好控制。临界区速度快,但无进入临界区无超时时间,对时间控制不精确。
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) -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)
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) -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)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
res/SimuRWLock.ico
res/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
res/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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.