Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32std.h
Link against: euser.lib

Class RUndertaker

RUndertaker

Support

Supported from 5.0

Description

Handle to a thread death notifier. The notifier allows threads to be notified of the death of another thread.

The thread-death notifier itself is a Kernel object.

As with all handles, they should be closed when they are no longer required.

Derivation

RHandleBaseHandle to an object
RUndertakerHandle to a thread death notifier

Defined in RUndertaker:
Create(), Logon(), LogonCancel()

Inherited from RHandleBase:
Close(), Duplicate(), Handle(), SetHandle()

See also:


Member functions


Create()

TInt Create();

Description

Creates a thread-death notifier, and opens this handle to that thread-death notifier.

Ownership of this thread-death notifier is vested in the current thread.

Return value

TInt

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


Logon()

TInt Logon(TRequestStatus& aStatus,TInt& aThreadHandle) const;

Description

Logon to the thread-death notifier represented by this handle.

Logging on makes an asynchronous request that the death of any other thread be reported.

When another thread dies, the request completes and TRquestStatus contains the value KErrDied; in addition, aThreadHandle contains the handle-number of the dying thread. The requesting thread can construct a proper handle for the dying thread using:

RThread r;r.SetHandle(aThreadHandle);...r.Close();

Alternatively, if an outstanding logon request is cancelled by a call to this handle's LogonCancel() member function, then the request completes with the value KErrCancel.

Note:

If a request completes normally, i.e. not as a result of a LogonCancel(), the handle to the dying thread must be closed when there is no further interest in it.

Parameters

TRequestStatus& aStatus

A reference to the request status object. If the request is cancelled, this is set to KErrCancel. If the request completes normally, this is set to KErrDied.

TInt& aThreadHandle

The handle-number representing the dying thread.

Return value

TInt

KErrInUse if already logged on, KErrNone otherwise.

See also:


LogonCancel()

TInt LogonCancel() const;

Description

Cancels an outstanding logon request to the thread-death notifier.

A logon request made by calling this handle's Logon() member function must previously have been made, otherwise the function returns KErrGeneral.

Return value

TInt

KErrGeneral if there is no outstanding logon request, KErrNone otherwise.