Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6INamedSemaphore::open ( const P6WCHAR pwszName,
P6SEMFLAG  flags,
P6INT32  initialValue,
P6FILEMODE  nMode 
)
pure virtual

Creates a new named semaphore or opens an existing semaphore.

The semaphore is identified by pwszName.

Parameters
pwszName[ in ] A pointer to a NULL terminated P6WCHAR string containing the name of the semaphore to open (and possibly create).
flags[ in ] P6SEMFLAG flags that control the behavior of open. If P6SF_CREATE is specified, then the semaphore is created if it does not already exist. If both P6SF_CREATE and P6SF_EXCLUIVE are specified then an error is returned if a semaphore with the same name already exists. If P6SF_CREATE is specified then the initialValue and nMode arguments are required, however, if a semaphore with the same name already exists, then the arguments will be ignored.
initialValue[ in ] An P6INT32 containing the initial value the semapore is to have.
nMode[ in ] This argument specifies the permission settings that a newly created semaphore will have. Both read and write permission should be granted to each class of user that will access the semaphore. On non-windows platforms the owner and group are set to the effective user and group of the calling processe.