Jump to content

DosCloseMuxWaitSem: Difference between revisions

From EDM2
Created page with "=== Syntax === rc = DosCloseMuxWaitSem( ''hmuxSemaphore'' ); === Parameters === HMUX ''hmuxSemaphore'' (input) The handle of the MuxWait semaphore to be closed. === Re..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== Syntax ===
DosCloseMuxWaitSem decrements the usage count of a specified MuxWait semaphore. If the usage count of the semaphore reaches zero, the system frees the MuxWait semaphore resources.


  rc = DosCloseMuxWaitSem( ''hmuxSemaphore'' );
==Syntax==
  DosCloseMuxWaitSem( ''hmuxSemaphore'' )


== Parameters ==
;HMUX ''hmuxSemaphore'' (input):The handle of the MuxWait semaphore to be closed.


=== Parameters ===
  HMUX ''hmuxSemaphore'' (input)
The handle of the MuxWait semaphore to be closed.
=== Returns ===
=== Returns ===
  APIRET rc
;APIRET rc:The following values can be returned
 
:0 - NO_ERROR - Operation was successful.
The following values can be returned
:6 - ERROR_INVALID_HANDLE - Error, The value in ''hmuxSemaphore'' does not point to a valid semaphore
   
:301 - ERROR_SEM_BUSY - Error, Another thread is currently blocking on this MuxWait semaphore.
{| border="1"
|-
|0
|NO_ERROR
|Operation was  
successful.
|-
|6
|ERROR_INVALID_HANDLE
|Error, The value in ''hmuxSemaphore'' does not point to a valid  
semaphore
|-
|301
|ERROR_SEM_BUSY
|Error,  
Another thread is currently blocking on this MuxWait semaphore.
|} 
=== Include Info ===
 
#define INCL_DOSSEMAPHORES
#include <os2.h>
 
 
=== Usage Explanation ===
 
DosCloseMuxWaitSem decrements the usage count of a specified MuxWait semaphore.
If the usage count of the semaphore reaches zero, the system frees the
MuxWait semaphore resources.
 
 
=== Relevant Structures ===
=== Gotchas ===
   
   
=== Sample Code ===
==Sample Code==
<PRE>
<PRE>
#define INCL_DOSSEMAPHORES
#define INCL_DOSSEMAPHORES
#include  
#include <os2.h>


HMUX  hmuxMySemaphore;    /* MySemaphore handle */
HMUX  hmuxMySemaphore;    /* MySemaphore handle */


/* access is gained to the semaphore in question */
/* access is gained to the semaphore in question */
Line 66: Line 32:
}
}
</PRE>
</PRE>
=== See Also ===
=== See Also ===
[[OS2 API:CPI:DosAddMuxWaitSem|CPI:DosAddMuxWaitSem]], [[OS2 API:CPI:DosCreateMuxWaitSem|CPI:DosCreateMuxWaitSem]], [[OS2 API:CPI:DosDeleteMuxWaitSem|CPI:DosDeleteMuxWaitSem]] [[OS2 API:CPI:DosOpenMuxWaitSem|CPI:DosOpenMuxWaitSem]], [[OS2 API:CPI:DosQueryMuxWaitSem|CPI:DosQueryMuxWaitSem]], [[OS2 API:CPI:DosWaitMuxWaitSem|CPI:DosWaitMuxWaitSem]]  
*[[DosAddMuxWaitSem]]
*[[DosCreateMuxWaitSem]]
*[[DosDeleteMuxWaitSem]]
*[[DosOpenMuxWaitSem]]
*[[DosQueryMuxWaitSem]]
*[[DosWaitMuxWaitSem]]  


[[Category:The OS/2 API Project]]
[[Category:Dos]]

Latest revision as of 20:44, 29 November 2019

DosCloseMuxWaitSem decrements the usage count of a specified MuxWait semaphore. If the usage count of the semaphore reaches zero, the system frees the MuxWait semaphore resources.

Syntax

DosCloseMuxWaitSem( hmuxSemaphore )

Parameters

HMUX hmuxSemaphore (input)
The handle of the MuxWait semaphore to be closed.

Returns

APIRET rc
The following values can be returned
0 - NO_ERROR - Operation was successful.
6 - ERROR_INVALID_HANDLE - Error, The value in hmuxSemaphore does not point to a valid semaphore
301 - ERROR_SEM_BUSY - Error, Another thread is currently blocking on this MuxWait semaphore.

Sample Code

 #define INCL_DOSSEMAPHORES
 #include <os2.h>

 HMUX  hmuxMySemaphore;     /* MySemaphore handle */

	/* access is gained to the semaphore in question */
	/* either by DosCreateMuxWaitSem ... */
	/* ... or by DosOpenMuxWaitSem */
	/* its handle is placed in hmuxMySemaphore */

	rc = DosCloseMuxWaitSem(hmuxMySemaphore);

	if (rc != 0)
	{
	  /* We got an error to take care of. */
	}

See Also