Problems using EnterCriticalSection

前端 未结 6 915
余生分开走
余生分开走 2021-02-03 14:51

I need to work with array from several threads, so I use CRITICAL SECTION to give it an exclusive access to the data.
Here is my template:

#include \"std         


        
6条回答
  •  猫巷女王i
    2021-02-03 15:32

    EnterCriticalSection doesn't take a const argument. That's a compilation error, BTW, not a linking error...

    Also, are you sure you want to pass in a critical section into your ctor, and then have the ctor perform the InitializeCriticalSection call? If you want to share your critical section, I suppose you'd initialize it first, and then hand it out.

提交回复
热议问题