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>TryInitializeUsingAutoStack</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>::TryInitializeUsingAutoStack</CODE> Member Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/os.h&gt;
14
15template &lt;typename T, typename U&gt;
16<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitializeUsingAutoStack(
17     void(*)(T) f,
18     U param,
19     size_t stackSize,
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 &lt;typename T&gt;
25<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitializeUsingAutoStack(
26     void(*)(T *) f,
27     const T & param,
28     size_t stackSize,
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 &lt;typename T&gt;
34<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitializeUsingAutoStack(
35     void(*)(const T *) f,
36     const T & param,
37     size_t stackSize,
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
42<a href="../../../nn/Result/Overview.html">nn::Result</a> TryInitializeUsingAutoStack(
43     void(*)() f,
44     size_t stackSize,
45     <a href="../../../nn_types/s32.html">s32</a> priority = PRIORITY_DEFAULT,
46     <a href="../../../nn_types/s32.html">s32</a> coreNo = CORE_NO_DEFAULT
47);
48</pre>
49    </div>
50    <h2>List of Overloaded Member Functions</h2>
51    <div class="section">
52      <table class="members">
53        <tr>
54          <td>
55            <a href="./TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack ( void(*)(T), U, size_t, s32, s32 ) </a>
56          </td>
57          <td>Automatically allocates stack and creates thread.</td>
58        </tr>
59        <tr>
60          <td>
61            <a href="./TryInitializeUsingAutoStack(1).html">TryInitializeUsingAutoStack ( void(*)(T *), const T &, size_t, s32, s32 ) </a>
62          </td>
63          <td>Automatically allocates stack and creates thread.</td>
64        </tr>
65        <tr>
66          <td>
67            <a href="./TryInitializeUsingAutoStack(2).html">TryInitializeUsingAutoStack ( void(*)(const T *), const T &, size_t, s32, s32 ) </a>
68          </td>
69          <td>Automatically allocates stack and creates thread.</td>
70        </tr>
71        <tr>
72          <td>
73            <a href="./TryInitializeUsingAutoStack(3).html">TryInitializeUsingAutoStack ( void(*)(), size_t, s32, s32 ) </a>
74          </td>
75          <td>Automatically allocates stack and creates thread.</td>
76        </tr> </table>
77    </div>
78    <h2>Description of I<CODE>TryInitializeUsingAutoStack ( void(*)(T), U, size_t, s32, s32 )</CODE></h2>
79    <div class="section"><p>Uses <CODE><a href="../../../nn/os/AutoStackManager/Overview.html">AutoStackManager</a></CODE> to allocate a stack and create 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>.
80            </p><p>
81                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 <CODE><a href="../../../nn/os/AutoStackManager/Overview.html">AutoStackManager</a></CODE> as configured by <CODE><a href="../../../nn/os/Thread/SetAutoStackManager.html">Thread::SetAutoStackManager</a></CODE>.
82            </p><p>
83                You need to call <CODE><a href="../../../nn/os/ManagedThread/InitializeEnvironment.html">InitializeEnvironment</a></CODE> before using <CODE>ManagedThread</CODE>.
84            </p></div>
85    <h2>Description of <CODE>TryInitializeUsingAutoStack ( void(*)(T *), const T &, size_t, s32, s32 )</CODE></h2>
86    <div class="section"><p>
87                Performs the same processing as the <CODE><a href="../../../nn/os/ManagedThread/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</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/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</a></CODE> function.
88            </p></div>
89    <h2>Description of I<CODE>TryInitializeUsingAutoStack ( void(*)(const T *), const T &, size_t, s32, s32 ) </CODE></h2>
90    <div class="section"><p>
91                Performs the same processing as the <CODE><a href="../../../nn/os/ManagedThread/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</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/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</a></CODE> function.
92            </p></div>
93    <h2>Description of I<CODE>TryInitializeUsingAutoStack ( void(*)(), size_t, s32, s32 )</CODE></h2>
94    <div class="section"><p>
95                Performs the same processing as the <CODE><a href="../../../nn/os/ManagedThread/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</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/TryInitializeUsingAutoStack(0).html">TryInitializeUsingAutoStack&lt;T, U&gt;</a></CODE> function.
96            </p></div>
97  <hr><p>CONFIDENTIAL</p></body>
98</html>