Description: 3.4.1 使用Win32互锁操作.p.58
这些函数中最常用的是InterlockedIncrement和Interlockedlncrerment。程序清单3-6是GoodCount,它是程序清单3-5中实例BadCourt的一个新版本。GoodCount使用InterlockedIncrement来完成全局变量的自动增一,它在所有的Windows 2000系统上都能正确地运行。
程序清单3-6 GoodCount程序,它展示了共享全局数据的正确方法
-3.4.1 The use of Win32 interlocked operations the are. P.58 the most commonly used functions InterlockedIncrement and Interlockedlncrerment. The procedures list 3-6 GoodCount, and it is a new version of the program in Listing 3-5 instances BadCourt. GoodCount use InterlockedIncrement to complete the global variables automatically increase, it can run on all Windows 2000 systems. Program the Listing 3-6 GoodCount program, it shows the correct way to shared global data Platform: |
Size: 6144 |
Author:dirdir |
Hits: