nn::os::ManagedThread::TryInitializeUsingAutoStack Member Function

Syntax

#include <nn/os.h>

template <typename T, typename U>
nn::Result TryInitializeUsingAutoStack(
     void(*)(T) f,
     U param,
     size_t stackSize,
     s32 priority = PRIORITY_DEFAULT,
     s32 coreNo = CORE_NO_DEFAULT
);

Template Arguments

Name Description
T Data type of argument(s) of the function to run (this type must be copyable).
U A type that can be converted to T.

Parameters

Name Description
in f Pointer to the function that will run on the created thread.
in param Parameter to pass for the f argument.
in stackSize Size of buffer for stack being allocated.
in priority Priority of the thread being created.
in coreNo Preferred processor for the thread being created.

Return Values

Returns the function's execution result.

Description

Automatically allocates stack and creates thread.

Uses AutoStackManager to allocate a stack and create a thread. To actually begin the processing of the thread you need to call Start.

The only argument this function takes is the size of stack to use. For allocation and deallocation of the memory region used for the stack, the processing is transferred to AutoStackManager as configured by Thread::SetAutoStackManager.

You need to call InitializeEnvironment before using ManagedThread.

Revision History

2012/04/13
Initial version.

CONFIDENTIAL