nn::os::ManagedThread::FindByStackAddress Member Function

Syntax

#include <nn/os.h>

static ManagedThread * FindByStackAddress(
     uptr address
);

Parameters

Name Description
in address The address to use as the thread search key.

Return Values

Returns the pointer to the ManagedThread corresponding to the thread that is using address as the stack. Returns NULL if not found.

Description

Gets the pointer to the ManagedThread from the stack address.

Searches among ManagedThread instances that have been initialized but not finalized to find the one for which address is being used as the stack.

It is determined that address is being used for the stack if address is in the range of GetStackBufferBegin to GetStackBufferEnd. Both ends are inclusive in the range. Note the following: If two thread stacks are using contiguous buffers, then the GetStackBufferBegin value of one thread is the same as the GetStackBufferEnd value of the other thread. So if you specify the same address for address, then the function will return the pointer corresponding to either of the threads.

This function is implemented using Enumerate, so it complies with Enumerate in terms of thread safety and internal function blocks. For details, see the Enumerate function.

Revision History

2012/04/13
Initial version.

CONFIDENTIAL