文件名称:Mutex
- 所属分类:
- 进程与线程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 944kb
- 下载次数:
- 0次
- 提 供 者:
- s**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
首先,在主线程中使用InitializeCriticalSection()初始化临界分区。然后建立两个子线程,在两个子线程中使用全局变量count的前、后分别使用 EnterCriticalSection()进入临界区及LeaveCriticalSection()退出临界区。等两个子线程运行完毕,主线程使用DeleteCriticalSection()删除临界区并撤销线程。-First of all, in the main thread InitializeCriticalSection () to initialize the critical partition. Then create two sub-threads, in two sub-thread count of global variables, respectively, using the EnterCriticalSection () to enter the critical section, and LeaveCriticalSection () to exit the critical section. The two sub-thread has finished running, the main thread to use DeleteCriticalSection () to delete the critical section and revoke the thread.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Mutex\Debug\Mutex.exe
.....\.....\Mutex.ilk
.....\.....\Mutex.pdb
.....\Mutex\Mutex.cpp
.....\.....\Mutex.h
.....\.....\Mutex.rc
.....\.....\Mutex.vcxproj
.....\.....\Mutex.vcxproj.filters
.....\.....\Mutex.vcxproj.user
.....\.....\ReadMe.txt
.....\.....\Resource.h
.....\.....\stdafx.cpp
.....\.....\stdafx.h
.....\.....\targetver.h
.....\Mutex.sln
.....\Mutex.suo
.....\ipch\mutex-720a10c3
.....\Debug
.....\ipch
.....\Mutex
Mutex
.....\.....\Mutex.ilk
.....\.....\Mutex.pdb
.....\Mutex\Mutex.cpp
.....\.....\Mutex.h
.....\.....\Mutex.rc
.....\.....\Mutex.vcxproj
.....\.....\Mutex.vcxproj.filters
.....\.....\Mutex.vcxproj.user
.....\.....\ReadMe.txt
.....\.....\Resource.h
.....\.....\stdafx.cpp
.....\.....\stdafx.h
.....\.....\targetver.h
.....\Mutex.sln
.....\Mutex.suo
.....\ipch\mutex-720a10c3
.....\Debug
.....\ipch
.....\Mutex
Mutex