int SomeInt=0;

InterlockedIncrement(&SomeInt);//自增

InterlockedDecrement(&SomeInt);//自减

 

InterlockedDecrement(&SomeInt)的执行过程是这样的
{
    //禁止其他线程访问 (&SomeInt) 这个地址
    SomeInt --;
    move EAX, someInt; // 设定返回值,C++函数的返回值 都放在EAX中,
    //开放其他线程访问 (&SomeInt) 这个地址
}

  

相关文章:

  • 2022-12-23
  • 2022-03-02
  • 2022-02-20
  • 2022-01-10
  • 2022-12-23
  • 2022-01-14
  • 2022-01-14
  • 2022-01-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2022-12-23
  • 2021-11-08
  • 2021-09-21
  • 2022-12-23
相关资源
相似解决方案