RSemaphore Class Reference

class RSemaphore : public RHandleBase

A handle to a semaphore.

The semaphore itself is a Kernel side object.

As with all handles, they should be closed after use. RHandleBase provides the necessary Close() function, which should be called when the handle is no longer required.

RHandleBase::Close

Inherits from

Member Functions Documentation

CreateGlobal(const TDesC &, TInt, TOwnerType)

IMPORT_C TIntCreateGlobal(const TDesC &aName,
TIntaCount,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const TDesC & aName
TInt aCount
TOwnerType aType = EOwnerProcess

CreateLocal(TInt, TOwnerType)

IMPORT_C TIntCreateLocal(TIntaCount,
TOwnerTypeaType = EOwnerProcess
)

Parameters

TInt aCount
TOwnerType aType = EOwnerProcess

Open(const TFindSemaphore &, TOwnerType)

TInt Open(const TFindSemaphore &aFind,
TOwnerTypeaType = EOwnerProcess
)[inline]

Opens a handle to the global semaphore found using a TFindSemaphore object.

A TFindSemaphore object is used to find all global semaphores whose full names match a specified pattern.

By default, any thread in the process can use this instance of RSemaphore to access the semaphore. However, specifying EOwnerThread as the second parameter to this function, means that only the opening thread can use this instance of RSemaphore to access the semaphore; any other thread in this process that wants to access the semaphore must either duplicate the handle or use OpenGlobal() again.

KErrNone if successful otherwise another of the system wide error codes.

Parameters

const TFindSemaphore & aFindA reference to the TFindSemaphore object used to find the semaphore.
TOwnerType aType = EOwnerProcessAn enumeration whose enumerators define the ownership of this semaphore handle. If not explicitly specified, EOwnerProcess is taken as default.

Open(RMessagePtr2, TInt, TOwnerType)

IMPORT_C TIntOpen(RMessagePtr2aMessage,
TIntaParam,
TOwnerTypeaType = EOwnerProcess
)

Parameters

RMessagePtr2 aMessage
TInt aParam
TOwnerType aType = EOwnerProcess

Open(TInt, TOwnerType)

IMPORT_C TIntOpen(TIntaArgumentIndex,
TOwnerTypeaType = EOwnerProcess
)

Parameters

TInt aArgumentIndex
TOwnerType aType = EOwnerProcess

OpenGlobal(const TDesC &, TOwnerType)

IMPORT_C TIntOpenGlobal(const TDesC &aName,
TOwnerTypeaType = EOwnerProcess
)

Parameters

const TDesC & aName
TOwnerType aType = EOwnerProcess

Signal()

IMPORT_C voidSignal()

Signal(TInt)

IMPORT_C voidSignal(TIntaCount)

Parameters

TInt aCount

Wait()

IMPORT_C voidWait()

Wait(TInt)

IMPORT_C TIntWait(TIntaTimeout)

Parameters

TInt aTimeout