Angelscript/docs/manual/group__api__multithread__fu...

392 lines
23 KiB
HTML
Raw Permalink Normal View History

2021-04-12 18:25:02 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AngelScript: Multi-thread support functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="aslogo_small.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">AngelScript
</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__api__multithread__functions.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Multi-thread support functions</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread</a> (<a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *externalMgr=0)</td></tr>
<tr class="memdesc:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets up the internally shared resources for multithreading. <a href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">More...</a><br /></td></tr>
<tr class="separator:gaa5bea65c3f2a224bb1c677515e3bb0e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga011355a8978d438cec77b4e1f041cba7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga011355a8978d438cec77b4e1f041cba7">asUnprepareMultithread</a> ()</td></tr>
<tr class="memdesc:ga011355a8978d438cec77b4e1f041cba7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Frees resources prepared for multithreading. <a href="group__api__multithread__functions.html#ga011355a8978d438cec77b4e1f041cba7">More...</a><br /></td></tr>
<tr class="separator:ga011355a8978d438cec77b4e1f041cba7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga948def50c98db90596b706ca4b58041e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga948def50c98db90596b706ca4b58041e">asGetThreadManager</a> ()</td></tr>
<tr class="memdesc:ga948def50c98db90596b706ca4b58041e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the thread manager used by the application. <a href="group__api__multithread__functions.html#ga948def50c98db90596b706ca4b58041e">More...</a><br /></td></tr>
<tr class="separator:ga948def50c98db90596b706ca4b58041e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga016dbf716a1c761b3f903b92eb8bb580"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga016dbf716a1c761b3f903b92eb8bb580">asAcquireExclusiveLock</a> ()</td></tr>
<tr class="memdesc:ga016dbf716a1c761b3f903b92eb8bb580"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire an exclusive lock. <a href="group__api__multithread__functions.html#ga016dbf716a1c761b3f903b92eb8bb580">More...</a><br /></td></tr>
<tr class="separator:ga016dbf716a1c761b3f903b92eb8bb580"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8a0617637eea3d76e33a52758b2cd49f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga8a0617637eea3d76e33a52758b2cd49f">asReleaseExclusiveLock</a> ()</td></tr>
<tr class="memdesc:ga8a0617637eea3d76e33a52758b2cd49f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release an exclusive lock. <a href="group__api__multithread__functions.html#ga8a0617637eea3d76e33a52758b2cd49f">More...</a><br /></td></tr>
<tr class="separator:ga8a0617637eea3d76e33a52758b2cd49f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa45545a038adcc8c73348cfe9488f32d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaa45545a038adcc8c73348cfe9488f32d">asAcquireSharedLock</a> ()</td></tr>
<tr class="memdesc:gaa45545a038adcc8c73348cfe9488f32d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire a shared lock. <a href="group__api__multithread__functions.html#gaa45545a038adcc8c73348cfe9488f32d">More...</a><br /></td></tr>
<tr class="separator:gaa45545a038adcc8c73348cfe9488f32d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga44f7327c5601e8dbf74768a2f3cc0dc3">asReleaseSharedLock</a> ()</td></tr>
<tr class="memdesc:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a shared lock. <a href="group__api__multithread__functions.html#ga44f7327c5601e8dbf74768a2f3cc0dc3">More...</a><br /></td></tr>
<tr class="separator:ga44f7327c5601e8dbf74768a2f3cc0dc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaf0074d581ac2edd06e63e56e4be52c8e">asAtomicInc</a> (int &amp;value)</td></tr>
<tr class="memdesc:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Increments the value by one and returns the result as a single atomic instruction. <a href="group__api__multithread__functions.html#gaf0074d581ac2edd06e63e56e4be52c8e">More...</a><br /></td></tr>
<tr class="separator:gaf0074d581ac2edd06e63e56e4be52c8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga0565bcb53be170dd85ae27a5b6f2b828">asAtomicDec</a> (int &amp;value)</td></tr>
<tr class="memdesc:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements the value by one and returns the result as a single atomic instruction. <a href="group__api__multithread__functions.html#ga0565bcb53be170dd85ae27a5b6f2b828">More...</a><br /></td></tr>
<tr class="separator:ga0565bcb53be170dd85ae27a5b6f2b828"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51079811680d5217046aad2a2b695dc7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#ga51079811680d5217046aad2a2b695dc7">asThreadCleanup</a> ()</td></tr>
<tr class="memdesc:ga51079811680d5217046aad2a2b695dc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cleans up memory allocated for the current thread. <a href="group__api__multithread__functions.html#ga51079811680d5217046aad2a2b695dc7">More...</a><br /></td></tr>
<tr class="separator:ga51079811680d5217046aad2a2b695dc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa0ffb789dab56b5617e2f961f9c79fdb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_lockable_shared_bool.html">asILockableSharedBool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__multithread__functions.html#gaa0ffb789dab56b5617e2f961f9c79fdb">asCreateLockableSharedBool</a> ()</td></tr>
<tr class="memdesc:gaa0ffb789dab56b5617e2f961f9c79fdb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a lockable shared boolean. <a href="group__api__multithread__functions.html#gaa0ffb789dab56b5617e2f961f9c79fdb">More...</a><br /></td></tr>
<tr class="separator:gaa0ffb789dab56b5617e2f961f9c79fdb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga016dbf716a1c761b3f903b92eb8bb580"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga016dbf716a1c761b3f903b92eb8bb580">&#9670;&nbsp;</a></span>asAcquireExclusiveLock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asAcquireExclusiveLock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This function will block the calling thread until there are no other threads that hold shared or exclusive locks. </p>
</div>
</div>
<a id="gaa45545a038adcc8c73348cfe9488f32d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa45545a038adcc8c73348cfe9488f32d">&#9670;&nbsp;</a></span>asAcquireSharedLock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asAcquireSharedLock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>This function will block the calling thread until there are no other threads that hold exclusive locks. Other threads may hold shared locks. </p>
</div>
</div>
<a id="ga0565bcb53be170dd85ae27a5b6f2b828"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0565bcb53be170dd85ae27a5b6f2b828">&#9670;&nbsp;</a></span>asAtomicDec()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asAtomicDec </td>
<td>(</td>
<td class="paramtype">int &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>A reference to the value that should be decremented </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The decremented value</dd></dl>
<p>This function is especially useful for implementing thread safe reference counters. </p>
</div>
</div>
<a id="gaf0074d581ac2edd06e63e56e4be52c8e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf0074d581ac2edd06e63e56e4be52c8e">&#9670;&nbsp;</a></span>asAtomicInc()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asAtomicInc </td>
<td>(</td>
<td class="paramtype">int &amp;&#160;</td>
<td class="paramname"><em>value</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>A reference to the value that should be incremented </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The incremented value</dd></dl>
<p>This function is especially useful for implementing thread safe reference counters. </p>
</div>
</div>
<a id="gaa0ffb789dab56b5617e2f961f9c79fdb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa0ffb789dab56b5617e2f961f9c79fdb">&#9670;&nbsp;</a></span>asCreateLockableSharedBool()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_lockable_shared_bool.html">asILockableSharedBool</a>* asCreateLockableSharedBool </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A new lockable shared boolean.</dd></dl>
<p>The lockable shared boolean will be created with an initial reference count of 1, and the boolean value false.</p>
<p>The object can be used for weak reference flags. </p>
</div>
</div>
<a id="ga948def50c98db90596b706ca4b58041e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga948def50c98db90596b706ca4b58041e">&#9670;&nbsp;</a></span>asGetThreadManager()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> <a class="el" href="classas_i_thread_manager.html">asIThreadManager</a>* asGetThreadManager </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>The thread manager prepared with <a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread()</a> </dd></dl>
</div>
</div>
<a id="gaa5bea65c3f2a224bb1c677515e3bb0e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa5bea65c3f2a224bb1c677515e3bb0e2">&#9670;&nbsp;</a></span>asPrepareMultithread()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asPrepareMultithread </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classas_i_thread_manager.html">asIThreadManager</a> *&#160;</td>
<td class="paramname"><em>externalMgr</em> = <code>0</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">externalMgr</td><td>Pre-existent thread manager (optional) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A negative value on error </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asINVALID_ARG</td><td>externalMgr informed even though local manager already exists</td></tr>
</table>
</dd>
</dl>
<p>Call this function from the main thread to set up shared resources for multithreading if engines are to be created in multiple threads.</p>
<p>If multiple modules (dlls) are used it may be necessary to call this with the thread manager retrieved from <a class="el" href="group__api__multithread__functions.html#ga948def50c98db90596b706ca4b58041e">asGetThreadManager()</a> in the main module in order for all modules to share the same thread manager.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="doc_adv_multithread.html">Multithreading</a> </dd></dl>
</div>
</div>
<a id="ga8a0617637eea3d76e33a52758b2cd49f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8a0617637eea3d76e33a52758b2cd49f">&#9670;&nbsp;</a></span>asReleaseExclusiveLock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asReleaseExclusiveLock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases the previously acquired exclusive lock. </p>
</div>
</div>
<a id="ga44f7327c5601e8dbf74768a2f3cc0dc3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga44f7327c5601e8dbf74768a2f3cc0dc3">&#9670;&nbsp;</a></span>asReleaseSharedLock()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asReleaseSharedLock </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Releases the previously acquired shared lock. </p>
</div>
</div>
<a id="ga51079811680d5217046aad2a2b695dc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga51079811680d5217046aad2a2b695dc7">&#9670;&nbsp;</a></span>asThreadCleanup()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> int asThreadCleanup </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>A negative value on error. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<tr><td class="paramname">asCONTEXT_ACTIVE</td><td>A context is still active.</td></tr>
</table>
</dd>
</dl>
<p>Call this function before terminating a thread that has accessed the engine to clean up memory allocated for that thread.</p>
<p>It's not necessary to call this if only a single thread accesses the engine. </p>
</div>
</div>
<a id="ga011355a8978d438cec77b4e1f041cba7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga011355a8978d438cec77b4e1f041cba7">&#9670;&nbsp;</a></span>asUnprepareMultithread()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="angelscript_8h.html#a6412a04ba6b2737922fdb2d8f822f51c">AS_API</a> void asUnprepareMultithread </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>If <a class="el" href="group__api__multithread__functions.html#gaa5bea65c3f2a224bb1c677515e3bb0e2">asPrepareMultithread()</a> has been called, then this function should be called after the last engine has been released to free the resources prepared for multithreading. </p>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated on Sat Dec 5 2020 23:20:25 for AngelScript by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
</ul>
</div>
</body>
</html>