wpReleaseObjectMutexSem - Example Code

In this example, you lock the folder pointed to by somSelf and enumerate all objects within the folder. When you are finished processing the objects in the folder, you unlock the folder.

WPObject    *Object;
BOOL        bSem;

bSem = !_wpRequestObjectMutexSem(somSelf,SEM_INDEFINITE_WAIT);
for (Object = _wpQueryContent(somSelf,NULL,QC_FIRST);
     Object;
     Object = _wpQueryContent(somSelf,Object,QC_NEXT));
{
   /***** Process the returned object *****/
}

if (bSem)
{
   _wpReleaseObjectMutexSem(somSelf);
}


[Back: wpReleaseObjectMutexSem - Related Methods]
[Next: wpReleaseObjectMutexSem - Topics]