Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32cmn.h
Link against: euser.lib

Class RFastLock

class RFastLock : public RSemaphore;

Description

A fast semaphore.

This is a layer over a standard semaphore, and only calls into the kernel side if there is contention.

Derivation

Members

Defined in RFastLock:
CreateLocal(), RFastLock(), Signal(), Wait()

Inherited from RHandleBase:
Attributes(), Close(), Duplicate(), FullName(), Handle(), HandleInfo(), Name(), SetHandle(), SetHandleNC(), SetReturnedHandle(), iHandle

Inherited from RSemaphore:
CreateGlobal(), Open(), OpenGlobal()


Construction and destruction


RFastLock()

inline RFastLock();

Description

Default constructor.

[Top]


Member functions


CreateLocal()

IMPORT_C TInt CreateLocal(TOwnerType aType=EOwnerProcess);

Description

Creates a local fast semaphore, and opens this handle to the semaphore.

Parameters

TOwnerType aType

An enumeration whose enumerators define the ownership of this semaphore handle. If not explicitly specified, EOwnerProcess is taken as default.

Return value

TInt

KErrNone if successful, otherwise one of the system wide error codes.

See also:


Wait()

IMPORT_C void Wait();

Description

Waits for a signal on the semaphore.

The function decrements the semaphore count by one and returns immediately if it is zero or positive.

If the semaphore count is negative after being decremented, the calling thread is added to a queue of threads maintained by this semaphore.

The thread waits until the semaphore is signalled. More than one thread can be waiting on a particular semaphore at a time. When there are multiple threads waiting on a semaphore, they are released in priority order.

If the semaphore is deleted, all threads waiting on that semaphore are released.


Signal()

IMPORT_C void Signal();

Description

Signals the semaphore once.

The function increments the semaphore count by one. If the count was negative before being incremented, the highest priority thread waiting on the semaphore's queue of threads is removed from that queue and, provided that it is not suspended for any other reason, is marked as ready to run.