线程同步之MUTEX

You can use a mutex object to protect a shared resource from simultaneous access by multiple threads or processes. Each thread must wait for ownership of the mutex before it can execute the code that accesses the shared resource. For example, if several threads share access to a database, the threads can use a mutex object to permit only one thread at a time to write to the database.

The following example (comes from MSDN)uses the CreateMutex function to create a mutex object and the CreateThread function to create worker threads.

上一篇:企业云存储:为什么中大型企业都偏爱自建企业云?


下一篇:企业云存储,为什么企业网盘是最佳选择?