svn: /phpdoc/en/trunk/internals2/memory/ TSRM.xml

From: Date: Wed, 10 Apr 2013 11:28:20 +0000
Subject: svn: /phpdoc/en/trunk/internals2/memory/ TSRM.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-11183@lists.php.net to get a copy of this message
krakjoe Wed, 10 Apr 2013 11:28:20 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=330053 Log: build fix Changed paths: U phpdoc/en/trunk/internals2/memory/TSRM.xml Modified: phpdoc/en/trunk/internals2/memory/TSRM.xml =================================================================== --- phpdoc/en/trunk/internals2/memory/TSRM.xml 2013-04-10 11:10:49 UTC (rev 330052) +++ phpdoc/en/trunk/internals2/memory/TSRM.xml 2013-04-10 11:28:20 UTC (rev 330053) @@ -42,88 +42,88 @@ </simpara> </note> + <title>TSRM API</title> + <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> + + <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> - <simpara> - <table xml:id="internals2.memory.tsrm.mapis"> - <title>TSRM Mutex API</title> + <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>

« previous php.doc.cvs (#11183) next »