1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" /> 7 <title>TryInitialize</title> 8 </head> 9 <body> 10 <h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/os/Overview.html">os</a>::<a href="../../../nn/os/ManagedThread/Overview.html">ManagedThread</a>::TryInitialize</CODE> Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nn/os.h> 14 15template <typename T, typename U, typename Stack> 16<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitialize( 17 void(*)(T) f, 18 U param, 19 Stack & stack, 20 <a href="../../../nn_types/s32.html">s32</a> priority = PRIORITY_DEFAULT, 21 <a href="../../../nn_types/s32.html">s32</a> coreNo = CORE_NO_DEFAULT 22); 23 24template <typename T, typename Stack> 25<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitialize( 26 void(*)(T *) f, 27 const T & param, 28 Stack & stack, 29 <a href="../../../nn_types/s32.html">s32</a> priority = PRIORITY_DEFAULT, 30 <a href="../../../nn_types/s32.html">s32</a> coreNo = CORE_NO_DEFAULT 31); 32 33template <typename T, typename Stack> 34<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitialize( 35 void(*)(const T *) f, 36 const T & param, 37 Stack & stack, 38 <a href="../../../nn_types/s32.html">s32</a> priority = PRIORITY_DEFAULT, 39 <a href="../../../nn_types/s32.html">s32</a> coreNo = CORE_NO_DEFAULT 40); 41 42template <typename Stack> 43<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitialize( 44 void(*)() f, 45 Stack & stack, 46 <a href="../../../nn_types/s32.html">s32</a> priority = PRIORITY_DEFAULT, 47 <a href="../../../nn_types/s32.html">s32</a> coreNo = CORE_NO_DEFAULT 48); 49</pre> 50 </div> 51 <h2>List of Overloaded Member Functions</h2> 52 <div class="section"> 53 <table class="members"> 54 <tr> 55 <td> 56 <a href="./TryInitialize(0).html">TryInitialize ( void(*)(T), U, Stack &, s32, s32 ) </a> 57 </td> 58 <td>Specifies a buffer for the stack and creates a thread.</td> 59 </tr> 60 <tr> 61 <td> 62 <a href="./TryInitialize(1).html">TryInitialize ( void(*)(T *), const T &, Stack &, s32, s32 ) </a> 63 </td> 64 <td>Specifies a buffer for the stack and creates a thread.</td> 65 </tr> 66 <tr> 67 <td> 68 <a href="./TryInitialize(2).html">TryInitialize ( void(*)(const T *), const T &, Stack &, s32, s32 ) </a> 69 </td> 70 <td>Specifies a buffer for the stack and creates a thread.</td> 71 </tr> 72 <tr> 73 <td> 74 <a href="./TryInitialize(3).html">TryInitialize ( void(*)(), Stack &, s32, s32 ) </a> 75 </td> 76 <td>Specifies a buffer for the stack and creates a thread.</td> 77 </tr> </table> 78 </div> 79 <h2>Description of <CODE>TryInitialize ( void(*)(T), U, Stack &, s32, s32 )</CODE></h2> 80 <div class="section"><p> 81 Uses the buffer specified by the user for a stack and creates a thread. To actually begin the processing of the thread you need to call <CODE><a href="../../../nn/os/ManagedThread/Start.html">Start</a></CODE>. 82 </p><p> 83 <SPAN class="argument">param</SPAN> is copied to the buffer once the value has been passed as the stack, and then passed from there as the <SPAN class="argument">f</SPAN> argument. 84 </p><p> 85 The <SPAN class="argument">stack</SPAN> argument must be a class instance that has the <CODE>GetStackBottom</CODE> member function (which returns an <CODE>uptr</CODE> type value as the address of the bottom of the stack) and the <CODE>GetStackSize</CODE> member function (which returns a <CODE>size_t</CODE> type value for the stack size. <CODE><a href="../../../nn/os/StackBuffer/Overview.html">StackBuffer</a></CODE> satisfies these conditions and can be used as the argument. 86 </p><p> 87 You need to call <CODE><a href="../../../nn/os/ManagedThread/InitializeEnvironment.html">InitializeEnvironment</a></CODE> before using <CODE>ManagedThread</CODE>. 88 </p></div> 89 <h2>Description of <CODE>TryInitialize ( void(*)(T *), const T &, Stack &, s32, s32 )</CODE></h2> 90 <div class="section"><p> 91 Performs the same processing as the <CODE><a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function, with the exception that the data referenced by <SPAN class="argument">param</SPAN> is copied to the buffer passed as the stack, and the pointer to that copied region is passed as the <SPAN class="argument">f</SPAN> argument. For details, see the <CODE><a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function. 92 </p></div> 93 <h2>Description of <CODE>TryInitialize ( void(*)(const T *), const T &, Stack &, s32, s32 )</CODE></h2> 94 <div class="section"><p> 95 Performs the same processing as the <CODE><a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function, with the exception that the data referenced by <SPAN class="argument">param</SPAN> is copied to the buffer passed as the stack, and the pointer to that copied region is passed as the <SPAN class="argument">f</SPAN> argument. For details, see the <CODE><a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function. 96 </p></div> 97 <h2>Description of <CODE>TryInitialize ( void(*)(), Stack &, s32, s32 ) </CODE></h2> 98 <div class="section"><p> 99 Performs the same processing as the <CODE> <a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function, with the exception that a function that does not take arguments is used as the thread function. For details, see the <CODE><a href="../../../nn/os/ManagedThread/TryInitialize(0).html">TryInitialize<T, U, Stack></a></CODE> function. 100 </p></div> 101 <hr><p>CONFIDENTIAL</p></body> 102</html>