views:

51

answers:

1
// locks a critical section, and unlocks it automatically
// when the lock goes out of scope
CAutoLock(CCritSec * plock)

The above is from wxutil.h, does it lock the access of different process , or just locks different threads in the same process?

+2  A: 

Just across threads. From the doc of CAutoLock:

The CAutoLock constructor locks the critical section, ...

and CCritSec:

The CCritSec class provides a thread lock.

More explicitly, from the description of Critical Section Objects:

A critical section object provides synchronization similar to that provided by a mutex object, except that a critical section can be used only by the threads of a single process.

KennyTM