摘要: 1.InterlockedIncrement保护多线程中操作的整数。#include #include volatile long g_nLoginCount; //登录次数 unsigned int __stdcall Fun(void *pPM); //线程函数 const DWORD THREAD_NUM = 50;//启动线程数 DWORD WINAPI ThreadFun(void *pPM) { Sleep(100);//some work should to do //g_nLoginCount++; InterlockedIncrem... 阅读全文
posted @ 2014-02-28 10:42 CPYER 阅读(511) 评论(0) 推荐(0) 编辑