wpRequestObjectMutexSem - Remarks

The Workplace Shell calls the wpRequestObjectMutexSem method to stop other threads from modifying an object while it is updating it. For example, when the Workplace Shell is enumerating the objects within a folder, it calls the wpRequestObjectMutexSem method for the folder to stop new objects from being added to the folder or old objects from being removed from the folder.

Each object has associated with it a mutex semaphore that can be used to serialize access to resources. This method is called to assert that the current thread indeed holds this mutex semaphore. Methods that expect to be invoked under semaphore protection can use this method to validate that the caller has indeed obtained ownership of the mutex semaphore.

This semaphore is used primarily to control access to the linked list of use items, but can be used for other purposes if needed. Folders also have a separate mutex semaphore, which is used to protect the content chain for that folder.

If you need both the object and the folder mutex semaphores, then you must obtain the folder mutex first.

If you need multiple object mutex semaphores, obtain them in object address order.

As with most semaphores, hold the semaphore for the minimum possible time.


[Back: wpRequestObjectMutexSem - Parameters]
[Next: wpRequestObjectMutexSem - Usage]