class RThread : public RHandleBase |
A handle to a thread.
The thread itself is a kernel object.
Private Member Functions | |
---|---|
IMPORT_C TBool | DoHasCapability(TCapability, const char *) |
IMPORT_C TBool | DoHasCapability(TCapability) |
IMPORT_C TBool | DoHasCapability(TCapability, TCapability, const char *) |
IMPORT_C TBool | DoHasCapability(TCapability, TCapability) |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
RThread | ( | ) | [inline] |
Default constructor.
The constructor exists to initialise private data within this handle; it does not create the thread object.
Specifically, it sets the handle-number to the value KCurrentThreadHandle. In effect, the constructor creates a default thread handle.
IMPORT_C TInt | Create | ( | const TDesC & | aName, |
TThreadFunction | aFunction, | |||
TInt | aStackSize, | |||
TInt | aHeapMinSize, | |||
TInt | aHeapMaxSize, | |||
TAny * | aPtr, | |||
TOwnerType | aType = EOwnerProcess | |||
) |
const TDesC & aName | |
TThreadFunction aFunction | |
TInt aStackSize | |
TInt aHeapMinSize | |
TInt aHeapMaxSize | |
TAny * aPtr | |
TOwnerType aType = EOwnerProcess |
IMPORT_C TInt | Create | ( | const TDesC & | aName, |
TThreadFunction | aFunction, | |||
TInt | aStackSize, | |||
RAllocator * | aHeap, | |||
TAny * | aPtr, | |||
TOwnerType | aType = EOwnerProcess | |||
) |
const TDesC & aName | |
TThreadFunction aFunction | |
TInt aStackSize | |
RAllocator * aHeap | |
TAny * aPtr | |
TOwnerType aType = EOwnerProcess |
IMPORT_C TInt | Create | ( | const TThreadCreateInfo & | aCreateInfo | ) |
const TThreadCreateInfo & aCreateInfo |
TInt | Create | ( | const TDesC & | aName, |
TThreadFunction | aFunction, | |||
TInt | aStackSize, | |||
TAny * | aPtr, | |||
RLibrary * | aLibrary, | |||
RHeap * | aHeap, | |||
TInt | aHeapMinSize, | |||
TInt | aHeapMaxSize, | |||
TOwnerType | aType | |||
) | [inline] |
Function only temporarily supported to aid migration to process emulation...
Use process emulation instead
const TDesC & aName | |
TThreadFunction aFunction | |
TInt aStackSize | |
TAny * aPtr | |
RLibrary * aLibrary | |
RHeap * aHeap | |
TInt aHeapMinSize | |
TInt aHeapMaxSize | |
TOwnerType aType |
IMPORT_C TBool | DoHasCapability | ( | TCapability | aCapability, |
const char * | aDiagnostic | |||
) | const [private] |
TCapability aCapability | |
const char * aDiagnostic |
IMPORT_C TBool | DoHasCapability | ( | TCapability | aCapability | ) | const [private] |
TCapability aCapability |
IMPORT_C TBool | DoHasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2, | |||
const char * | aDiagnostic | |||
) | const [private] |
TCapability aCapability1 | |
TCapability aCapability2 | |
const char * aDiagnostic |
IMPORT_C TBool | DoHasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2 | |||
) | const [private] |
TCapability aCapability1 | |
TCapability aCapability2 |
IMPORT_C TInt | GetCpuTime | ( | TTimeIntervalMicroSeconds & | aCpuTime | ) | const |
TTimeIntervalMicroSeconds & aCpuTime |
IMPORT_C void | HandleCount | ( | TInt & | aProcessHandleCount, |
TInt & | aThreadHandleCount | |||
) | const |
TBool | HasCapability | ( | TCapability | aCapability, |
const char * | aDiagnostic = 0 | |||
) | const [inline] |
Check if the process to which the thread belongs has a given capability
When a check fails the action taken is determined by the system wide Platform Security configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. If PlatSecEnforcement is OFF, then this function will return ETrue even though the check failed.
ETrue if the process to which the thread belongs has the capability, EFalse otherwise.
TCapability aCapability | The capability to test. |
const char * aDiagnostic = 0 | A string that will be emitted along with any diagnostic message that may be issued if the test finds the capability is not present. This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro which enables it to be easily removed from the system. |
TBool | HasCapability | ( | TCapability | aCapability1, |
TCapability | aCapability2, | |||
const char * | aDiagnostic = 0 | |||
) | const [inline] |
Check if the process to which the thread belongs has both of the given capabilities
When a check fails the action taken is determined by the system wide Platform Security configuration. If PlatSecDiagnostics is ON, then a diagnostic message is emitted. If PlatSecEnforcement is OFF, then this function will return ETrue even though the check failed.
ETrue if the process to which the thread belongs has both the capabilities, EFalse otherwise.
TCapability aCapability1 | The first capability to test. |
TCapability aCapability2 | The second capability to test. |
const char * aDiagnostic = 0 | A string that will be emitted along with any diagnostic message that may be issued if the test finds a capability is not present. This string must be enclosed in the __PLATSEC_DIAGNOSTIC_STRING macro which enables it to be easily removed from the system. |
IMPORT_C void | Logon | ( | TRequestStatus & | aStatus | ) | const |
TRequestStatus & aStatus |
IMPORT_C TInt | LogonCancel | ( | TRequestStatus & | aStatus | ) | const |
TRequestStatus & aStatus |
IMPORT_C TInt | Open | ( | const TDesC & | aFullName, |
TOwnerType | aType = EOwnerProcess | |||
) |
const TDesC & aFullName | |
TOwnerType aType = EOwnerProcess |
IMPORT_C TInt | Open | ( | TThreadId | aID, |
TOwnerType | aType = EOwnerProcess | |||
) |
TThreadId aID | |
TOwnerType aType = EOwnerProcess |
TInt | Open | ( | const TFindThread & | aFind, |
TOwnerType | aType = EOwnerProcess | |||
) | [inline] |
Opens a handle to the thread found by pattern matching a name.
A TFindThread object is used to find all threads whose full names match a specified pattern.
By default, ownership of this thread handle is vested in the current process, but can be vested in the current thread by passing EOwnerThread as the second parameter to this function.
KErrNone if successful, otherwise one of the other system-wide error codes.
const TFindThread & aFind | A reference to the TFindThread object used to find the thread. |
TOwnerType aType = EOwnerProcess | An enumeration whose enumerators define the ownership of this thread handle. If not explicitly specified, EOwnerProcess is taken as default. |
TInt | RenameMe | ( | const TDesC & | aName | ) | [static, inline] |
Use User::RenameThread() instead
const TDesC & aName |
IMPORT_C void | Rendezvous | ( | TRequestStatus & | aStatus | ) | const |
TRequestStatus & aStatus |
IMPORT_C TInt | RendezvousCancel | ( | TRequestStatus & | aStatus | ) | const |
TRequestStatus & aStatus |
IMPORT_C void | RequestComplete | ( | TRequestStatus *& | aStatus, |
TInt | aReason | |||
) | const |
TRequestStatus *& aStatus | |
TInt aReason |
IMPORT_C TSecureId | SecureId | ( | ) | const |
Return the Secure ID of the process to which the thread belongs.
If an intended use of this method is to check that the Secure ID is a given value, then the use of a TSecurityPolicy object should be considered. E.g. Instead of something like:
RThread& thread; TInt error = thread.SecureId()==KRequiredSecureId ? KErrNone : KErrPermissionDenied;
this could be used;
RThread& thread; static _LIT_SECURITY_POLICY_S0(mySidPolicy, KRequiredSecureId); TBool pass = mySidPolicy().CheckPolicy(thread);
This has the benefit that the TSecurityPolicy::CheckPolicy methods are configured by the system wide Platform Security configuration. I.e. are capable of emitting diagnostic messages when a check fails and/or the check can be forced to always pass.
TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
_LIT_SECURITY_POLICY_S0
The Secure ID.
IMPORT_C void | SetPriority | ( | TThreadPriority | aPriority | ) | const |
TThreadPriority aPriority |
IMPORT_C void | SetProcessPriority | ( | TProcessPriority | aPriority | ) | const |
TProcessPriority aPriority |
IMPORT_C TInt | StackInfo | ( | TThreadStackInfo & | aInfo | ) | const |
TThreadStackInfo & aInfo |
IMPORT_C TVendorId | VendorId | ( | ) | const |
Return the Vendor ID of the process to which the thread belongs.
If an intended use of this method is to check that the Vendor ID is a given value, then the use of a TSecurityPolicy object should be considered. E.g. Instead of something like:
RThread& thread; TInt error = thread.VendorId()==KRequiredVendorId ? KErrNone : KErrPermissionDenied;
this could be used;
RThread& thread; static _LIT_SECURITY_POLICY_V0(myVidPolicy, KRequiredVendorId); TBool pass = myVidPolicy().CheckPolicy(thread);
This has the benefit that the TSecurityPolicy::CheckPolicy methods are configured by the system wide Platform Security configuration. I.e. are capable of emitting diagnostic messages when a check fails and/or the check can be forced to always pass.
TSecurityPolicy::CheckPolicy(RThread aThread, const char* aDiagnostic) const
_LIT_SECURITY_POLICY_V0
The Vendor ID.