Jump to content

FSH SEMREQUEST: Difference between revisions

From EDM2
Created page with "This function allows an FSD to obtain exclusive access to a semaphore. ==Syntax== FSH_SEMREQUEST(pSem, cmsTimeout) ==Parameters== ;pSem: is the handle to the system semaph..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
This function allows an FSD to obtain exclusive access to a semaphore.  
This function allows an FSD to obtain exclusive access to a semaphore.
 
==Syntax==
==Syntax==
  FSH_SEMREQUEST(pSem, cmsTimeout)
  FSH_SEMREQUEST(pSem, cmsTimeout)
==Parameters==
==Parameters==
;pSem: is the handle to the system semaphore or the long address of the ram semaphore.  
;pSem: is the handle to the system semaphore or the long address of the ram semaphore.
;cmsTimeout: is the number of milliseconds to wait.


;cmsTimeout: is the number of milliseconds to wait.
==Returns==
==Returns==
If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:  
If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:
 
*ERROR_INTERRUPT the current thread received a signal.
*ERROR_INTERRUPT the current thread received a signal.  
*ERROR_SEM_TIMEOUT the time-out expired without gaining access to the semaphore.
*ERROR_SEM_OWNER_DIED the owner of the semaphore died.
*ERROR_TOO_MANY_SEM_REQUESTS there are too many semaphore requests in progress.
*ERROR_PROTECTION_VIOLATION the semaphore is inaccessible.


*ERROR_SEM_TIMEOUT the time-out expired without gaining access to the semaphore. 
*ERROR_SEM_OWNER_DIED the owner of the semaphore died. 
*ERROR_TOO_MANY_SEM_REQUESTS there are too many semaphore requests in progress. 
*ERROR_PROTECTION_VIOLATION the semaphore is inaccessible.
==Calling Sequence==
==Calling Sequence==
<PRE>
<PRE>
Line 25: Line 23:
unsigned long cmsTimeout;
unsigned long cmsTimeout;
</PRE>
</PRE>
==Remarks==
==Remarks==
The time-out value of 0xFFFFFFFF indicates an indefinite time-out.  
The time-out value of 0xFFFFFFFF indicates an indefinite time-out.


The caller may receive access to the semaphore after the time-out period has expired without receiving an ERROR_SEM_TIMEOUT. Semaphore time-out values, therefore, should not be used for exact timing and sequencing.  
The caller may receive access to the semaphore after the time-out period has expired without receiving an ERROR_SEM_TIMEOUT. Semaphore time-out values, therefore, should not be used for exact timing and sequencing.


FSH_SEMREQUEST may block.  
FSH_SEMREQUEST may block.


;Note:   OS/2 does not validate input parameters. An FSD, therefore, should call FSH_PROBEBUF where appropriate.  
;Note: OS/2 does not validate input parameters. An FSD, therefore, should call FSH_PROBEBUF where appropriate.


[[Category:IFS Interfaces]]
[[Category:IFS Interfaces]]
{{DISPLAYTITLE:FSH_SEMREQUEST}}
{{DISPLAYTITLE:FSH_SEMREQUEST}}

Latest revision as of 05:44, 20 February 2020

This function allows an FSD to obtain exclusive access to a semaphore.

Syntax

FSH_SEMREQUEST(pSem, cmsTimeout)

Parameters

pSem
is the handle to the system semaphore or the long address of the ram semaphore.
cmsTimeout
is the number of milliseconds to wait.

Returns

If no error is detected, a zero error code is returned. If an error is detected, one of the following error codes is returned:

  • ERROR_INTERRUPT the current thread received a signal.
  • ERROR_SEM_TIMEOUT the time-out expired without gaining access to the semaphore.
  • ERROR_SEM_OWNER_DIED the owner of the semaphore died.
  • ERROR_TOO_MANY_SEM_REQUESTS there are too many semaphore requests in progress.
  • ERROR_PROTECTION_VIOLATION the semaphore is inaccessible.

Calling Sequence

int far pascal FSH_SEMREQUEST(pSem, cmsTimeout)

void far * pSem;
unsigned long cmsTimeout;

Remarks

The time-out value of 0xFFFFFFFF indicates an indefinite time-out.

The caller may receive access to the semaphore after the time-out period has expired without receiving an ERROR_SEM_TIMEOUT. Semaphore time-out values, therefore, should not be used for exact timing and sequencing.

FSH_SEMREQUEST may block.

Note
OS/2 does not validate input parameters. An FSD, therefore, should call FSH_PROBEBUF where appropriate.