Class to get a thread safe count of prev - 项目摘要 |
摘要
| 管理 |
论坛 文档
| 软件包 |
|
|
|
项目描述: |
There have been many examples,posted on CodeGuru, of how to check for a previously running instance of an application. Some used DDE, others mutexs but what struck me as the easiest suggestion was to use a 'shared section' to store a flag - accessable by every instance.
The following class uses that technique, along with a couple of the 'interlocked' functions to make it threadsafe. Instead of a simple flag, a count of running instances is kept.
在CodeGuru上有很多文章讲述了如何检查一个应用程序的以前运行的实例。一些使用DDE,一些使用互斥量。令我感觉最容易的方法是使用一个“共享段”来保存一个标记-可以由每个实例访问。
项目的类使用了这种技术,提供了一对 'interlocked'函数生成安全线程。不是使用一个标记,而是保存了运行的实例的数量。
来源: http://www.codeguru.com/win32/previnst.shtml |
类别: |
|
发布者:
cbd002
|
|
最新发布源码包 |
软件包 |
版本号 |
日期 |
本地下载 |
EvtManager |
 1.0  |
2004-03-22 |
下载 |
|
|