<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://panoptic.com/mediawiki/aolserver/index.php?action=history&amp;feed=atom&amp;title=Ns_sema</id>
	<title>Ns sema - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://panoptic.com/mediawiki/aolserver/index.php?action=history&amp;feed=atom&amp;title=Ns_sema"/>
	<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_sema&amp;action=history"/>
	<updated>2026-04-13T01:36:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_sema&amp;diff=2686&amp;oldid=prev</id>
		<title>WikiSysop: imported from WiKit id 651</title>
		<link rel="alternate" type="text/html" href="https://panoptic.com/mediawiki/aolserver/index.php?title=Ns_sema&amp;diff=2686&amp;oldid=prev"/>
		<updated>2004-06-15T19:16:58Z</updated>

		<summary type="html">&lt;p&gt;imported from WiKit id 651&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Man page: http://aolserver.com/docs/tcl/ns_sema.html&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
'''NAME'''&lt;br /&gt;
&lt;br /&gt;
: ns_sema - Operate on semaphore-like objects&lt;br /&gt;
&lt;br /&gt;
'''SYNOPSIS'''&lt;br /&gt;
&lt;br /&gt;
: '''ns_sema''' ''option ?arg arg ...?''&lt;br /&gt;
&lt;br /&gt;
'''DESCRIPTION'''&lt;br /&gt;
&lt;br /&gt;
: This command provides a mechanism to manipulate semaphore-like objects but are not inter-process capable like true semaphores.  They are actually implemented with a mutex and a counter.  The legal ''option''s (which may be abbreviated) are:&lt;br /&gt;
* '''ns_sema create ?count?'''&lt;br /&gt;
&lt;br /&gt;
: Initializes a new semaphore whose count is initialized to zero by default or ''count'' otherwise.  Returns a handle to the semaphore object.&lt;br /&gt;
* '''ns_sema destroy''' ''object''&lt;br /&gt;
&lt;br /&gt;
: Destroys the semaphore object and frees any resources it was using.&lt;br /&gt;
* '''ns_sema release''' ''object ?count?'' &lt;br /&gt;
&lt;br /&gt;
: Releases the semaphore object by incrementing the counter by one by default or by ''count'' otherwise.  The thread will wake any threads blocking on this semaphore when count is equal to one.&lt;br /&gt;
&lt;br /&gt;
: This is what is commonly referred to as &amp;quot;semaphore up&amp;quot;.&lt;br /&gt;
* '''ns_sema wait''' ''object''&lt;br /&gt;
&lt;br /&gt;
: Waits for a semaphore object to be greater than zero.  Will block the thread until this is true.  Decrements the counter by one when the counter is greater than zero.&lt;br /&gt;
&lt;br /&gt;
: This is what is commonly referred to as &amp;quot;semaphore down&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''EXAMPLES'''&lt;br /&gt;
&lt;br /&gt;
    # need an example here&lt;br /&gt;
&lt;br /&gt;
'''SEE ALSO'''&lt;br /&gt;
&lt;br /&gt;
: [[ns_cond]], [[ns_critsec]], [[ns_event]], [[ns_mutex]], [[ns_thread]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Category Documentation]] - [[Category Core Tcl API]]&lt;/div&gt;</summary>
		<author><name>WikiSysop</name></author>
		
	</entry>
</feed>