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 <nn/os.h> 14 15template <typename T, typename U> 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</pre> 24 </div> 25 <h2>Template Arguments</h2> 26 <div class="section"> 27 <table class="arguments"> 28 <thead> 29 <tr> 30 <th>Name</th> 31 <td>Description</td> 32 </tr> 33 </thead> 34 <tr> 35 <th>T</th> 36 <td>Data type of argument(s) of the function to run (this type must be copyable).</td> 37 </tr> 38 <tr> 39 <th>U</th> 40 <td>A type that can be converted to <SPAN class="argument">T</SPAN>.</td> 41 </tr> </table> 42 </div> 43 <h2>Parameters</h2> 44 <div class="section"> 45 <table class="arguments"> 46 <thead> 47 <tr> 48 <td width="15" /> 49 <th>Name</th> 50 <td>Description</td> 51 </tr> 52 </thead> 53 <tr> 54 <td>in</td> 55 <th>f</th> 56 <td>Pointer to the function that will run on the created thread.</td> 57 </tr> 58 <tr> 59 <td>in</td> 60 <th>param</th> 61 <td>Parameter to pass for the <SPAN class="argument">f</SPAN> argument.</td> 62 </tr> 63 <tr> 64 <td>in</td> 65 <th>stackSize</th> 66 <td>Size of buffer for stack being allocated.</td> 67 </tr> 68 <tr> 69 <td>in</td> 70 <th>priority</th> 71 <td>Priority of the thread being created.</td> 72 </tr> 73 <tr> 74 <td>in</td> 75 <th>coreNo</th> 76 <td>Preferred processor for the thread being created.</td> 77 </tr> </table> 78 </div> 79 <h2>Return Values</h2> 80 <div class="section">Returns the function's execution result. </div> 81 <h2>Description</h2> 82 <div class="section"> 83 <p>Automatically allocates stack and creates thread.</p><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>. 84 </p><p> 85 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>. 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>Revision History</h2> 90 <div class="section"> 91 <dl class="history"> 92 <dt>2012/04/13</dt> 93 <dd>Initial version.<br /> 94 </dd> 95 </dl> 96 </div> 97 <hr><p>CONFIDENTIAL</p></body> 98</html>