mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
build fix
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330053 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
846c44309b
commit
24131f7d82
1 changed files with 80 additions and 81 deletions
|
@ -42,88 +42,88 @@
|
|||
</simpara>
|
||||
</note>
|
||||
|
||||
<simpara>
|
||||
The API documented hereafter is aimed at advanced use of TSRM. It is not ordinary for extensions to have to interact with TSRM directly, the pecl programmer should use API's above TSRM such as the Module Globals API which used correctly will ensure safety in ZTS mode for you.
|
||||
|
||||
<table xml:id="internals2.memory.tsrm.iapis">
|
||||
<title>TSRM Internals</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Prototype</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry><code>typedef int ts_rsrc_id</code></entry>
|
||||
<entry>The type definition to represent a resource by numeric identifiers</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)</code></entry>
|
||||
<entry><code>expected_threads</code> and <code>expected_resources</code> are not hard limits. <code>debug_level</code> and <code>debug_filename</code> only have an effect on windows in Debug mode or when TSRM_DEBUG is defined. Called once per process in ZTS mode during server startup.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void tsrm_shutdown(void)</code></entry>
|
||||
<entry>
|
||||
Should be the last thing called in the process to destroy and free all storage TSRM storage in ZTS mode.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)</code></entry>
|
||||
<entry>
|
||||
Allocates and thread safe pointer of <code>size</code> bytes, calling <code>ctor</code> on the pointer, assigning (and returning) the id to <code>rsrc_id</code>, the <code>dtor</code> is called when the resource is free'd. Module globals are isolated in ZTS mode using this API.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)</code></entry>
|
||||
<entry>
|
||||
Fetches a resource by previously allocated <code>id</code> from the entries created by the specified thread identifed by <code>th_id</code>.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<code>void *ts_resource(ts_rsrc_id id)</code>
|
||||
</entry>
|
||||
<entry>
|
||||
Fetches a resource by previously allocated <code>id</code> from the entries created by the calling thread.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void ts_free_thread(void)</code></entry>
|
||||
<entry>
|
||||
Destroys and frees the entries for the calling thread, currently this API is only used by ISAPI module.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<code>void ts_free_id(ts_rsrc_id id)</code>
|
||||
</entry>
|
||||
<entry>
|
||||
Destroys the resource identified by previously allocated <code>id</code>. Module globals are cleaned up in ZTS mode using this API.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<note>
|
||||
<simpara>There are more TSRM API functions to enable the creation and destruction of interpreter contexts, the usage of such functionality is out of the scope of this documentation, please see TSRM/TSRM.h for more information.</simpara>
|
||||
</note>
|
||||
|
||||
</simpara>
|
||||
<title>TSRM API</title>
|
||||
|
||||
<simpara>
|
||||
<table xml:id="internals2.memory.tsrm.mapis">
|
||||
<title>TSRM Mutex API</title>
|
||||
The API documented hereafter is aimed at advanced use of TSRM. It is not ordinary for extensions to have to interact with TSRM directly, the pecl programmer should use API's above TSRM such as the Module Globals API which used correctly will ensure safety in ZTS mode for you.
|
||||
</simpara>
|
||||
|
||||
<table xml:id="internals2.memory.tsrm.iapis">
|
||||
<title>TSRM Internals</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Prototype</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<row>
|
||||
<entry><code>typedef int ts_rsrc_id</code></entry>
|
||||
<entry>The type definition to represent a resource by numeric identifiers</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>int tsrm_startup(int expected_threads, int expected_resources, int debug_level, char *debug_filename)</code></entry>
|
||||
<entry><code>expected_threads</code> and <code>expected_resources</code> are not hard limits. <code>debug_level</code> and <code>debug_filename</code> only have an effect on windows in Debug mode or when TSRM_DEBUG is defined. Called once per process in ZTS mode during server startup.</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void tsrm_shutdown(void)</code></entry>
|
||||
<entry>
|
||||
Should be the last thing called in the process to destroy and free all storage TSRM storage in ZTS mode.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>ts_rsrc_id ts_allocate_id(ts_rsrc_id *rsrc_id, size_t size, ts_allocate_ctor ctor, ts_allocate_dtor dtor)</code></entry>
|
||||
<entry>
|
||||
Allocates and thread safe pointer of <code>size</code> bytes, calling <code>ctor</code> on the pointer, assigning (and returning) the id to <code>rsrc_id</code>, the <code>dtor</code> is called when the resource is free'd. Module globals are isolated in ZTS mode using this API.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void *ts_resource_ex(ts_rsrc_id id, THREAD_T *th_id)</code></entry>
|
||||
<entry>
|
||||
Fetches a resource by previously allocated <code>id</code> from the entries created by the specified thread identifed by <code>th_id</code>.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<code>void *ts_resource(ts_rsrc_id id)</code>
|
||||
</entry>
|
||||
<entry>
|
||||
Fetches a resource by previously allocated <code>id</code> from the entries created by the calling thread.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><code>void ts_free_thread(void)</code></entry>
|
||||
<entry>
|
||||
Destroys and frees the entries for the calling thread, currently this API is only used by ISAPI module.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry>
|
||||
<code>void ts_free_id(ts_rsrc_id id)</code>
|
||||
</entry>
|
||||
<entry>
|
||||
Destroys the resource identified by previously allocated <code>id</code>. Module globals are cleaned up in ZTS mode using this API.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
||||
<note>
|
||||
<simpara>There are more TSRM API functions to enable the creation and destruction of interpreter contexts, the usage of such functionality is out of the scope of this documentation, please see TSRM/TSRM.h for more information.</simpara>
|
||||
</note>
|
||||
|
||||
<title>TSRM Mutex API</title>
|
||||
<table>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
|
@ -164,7 +164,6 @@
|
|||
<note>
|
||||
<simpara>The mutex API is exposed by TSRM. However, its internal usage is far too wide to document usefully here, none the less, basic functionality and prototypes are documented here.</simpara>
|
||||
</note>
|
||||
</simpara>
|
||||
|
||||
|
||||
</sect1>
|
||||
|
|
Loading…
Reference in a new issue