[ Home | Alpha index | Topic index | Tutorials | Download | Feedback ]

The OS/2 API Project

DosPostEventSem

[ Syntax | Params | Returns | Include | Usage | Structs | Gotchas | Code | Also ]

Syntax

rc = DosPostEventSem( hevSemaphore );

Parameters

HEV hevSemaphore (input)
The handle of the semaphore to be posted.

Returns

APIRET rc
The following values can be returned
0NO_ERRORSemaphore posted successfully
6ERROR_INVALID_HANDLEError, The value in phevSemaphore does not point to a valid semaphore, The calling process must first have access to the semaphore in question
298ERROR_TOO_MANY_POSTSError, The call increased the post count beyond the system limit of 65535 posts.
299ERROR_ALREADY_POSTEDError, not fatal, The semaphore has already been posted, The post count has been increased by one.

Include Info

#define INCL_DOSSEMAPHORES
#include <os2.h>

Usage Explanation

DosPostEventSem increments, by one (1), the post count of the event semaphore referred to by hevSemaphore. If the semaphore has already been posted since the last reset, ERROR_ALREADY_POSTED is returned. This is not fatal and the post count is still incremented.

Relevant Structures

Gotchas

The process calling DosPostEventSem must first obtain access to the semaphore in question or ERROR_INVALID_HANDLE will be returned.

Sample Code

#define INCL_DOSSEMAPHORES #include <os2.h> HEV hevMySemaphore; /* MySemaphore handle */ /* access is gained to the semaphore in question */ /* either by DosCreateEventSem ... */ /* ... or by DosOpenEventSem */ /* its handle is placed in hevMySemaphore */ /* process becomes owner of semaphore */ /* by way of successful call to DosRequestEventSem */ rc = DosPostEventSem(hevMySemaphore); if (rc != 0) { /* We got an error to take care of. */ }

See Also

DosCloseEventSem, DosCreateEventSem, DosOpenEventSem, DosQueryEventSem, DosResetEventSem DosWaitEventSem

Author

Joe Phillips - jaiger@eng2.uconn.edu

Additions

Last modified June 19/1996
Please send all errors, comments, and suggestions to: timur@vnet.ibm.com

The OS/2 API Project

DosPostEventSem