#include <Windows.h>
#include "hyport.h"
#include "portpriv.h"
#include "ut_hyprt.h"
#include "hyshsem.h"
Functions | |
IDATA VMCALL | hyshsem_open (struct HyPortLibrary *portLibrary, struct hyshsem_handle **handle, const char *semname, int setSize, int permission) |
Open an existing semaphore set, or create a new one if it does not exist. | |
IDATA VMCALL | hyshsem_post (struct HyPortLibrary *portLibrary, struct hyshsem_handle *handle, UDATA semset, UDATA flag) |
post operation increments the counter in the semaphore by 1 if there is no one in wait for the semaphore. | |
IDATA VMCALL | hyshsem_wait (struct HyPortLibrary *portLibrary, struct hyshsem_handle *handle, UDATA semset, UDATA flag) |
Wait operation decrements the counter in the semaphore set if the counter > 0 if counter == 0 then the caller will be suspended. | |
IDATA VMCALL | hyshsem_getVal (struct HyPortLibrary *portLibrary, struct hyshsem_handle *handle, UDATA semset) |
reading the value of the semaphore in the set. | |
IDATA VMCALL | hyshsem_setVal (struct HyPortLibrary *portLibrary, struct hyshsem_handle *handle, UDATA semset, IDATA value) |
setting the value of the semaphore specified in semset. | |
void VMCALL | hyshsem_close (struct HyPortLibrary *portLibrary, struct hyshsem_handle **handle) |
Release the resources allocated for the semaphore handles. | |
IDATA VMCALL | hyshsem_destroy (struct HyPortLibrary *portLibrary, struct hyshsem_handle **handle) |
Destroy the semaphore and release the resources allocated for the semaphore handles. | |
I_32 VMCALL | hyshsem_startup (struct HyPortLibrary *portLibrary) |
PortLibrary startup. | |
void VMCALL | hyshsem_shutdown (struct HyPortLibrary *portLibrary) |
PortLibrary shutdown. |
void VMCALL hyshsem_close | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle ** | handle | |||
) |
Release the resources allocated for the semaphore handles.
[in] | portLibrary | The port library. |
[in] | handle | Semaphore set handle. |
IDATA VMCALL hyshsem_destroy | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle ** | handle | |||
) |
Destroy the semaphore and release the resources allocated for the semaphore handles.
[in] | portLibrary | The port library. |
[in] | handle | Semaphore set handle. |
IDATA VMCALL hyshsem_getVal | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle * | handle, | |||
UDATA | semset | |||
) |
reading the value of the semaphore in the set.
This function uses no synchronisation prmitives
[in] | portLibrary | The port library. |
[in] | handle | Semaphore set handle. |
[in] | semset | The number of semaphore in the semaphore set that you want to post. |
IDATA VMCALL hyshsem_open | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle ** | handle, | |||
const char * | semname, | |||
int | setSize, | |||
int | permission | |||
) |
Open an existing semaphore set, or create a new one if it does not exist.
[in] | portLibrary | The port library. |
[out] | handle | A semaphore handle is allocated and initialised for use with further calls, NULL on failure. |
[in] | semname | Unique identifier of the semaphore. |
[in] | setSize | Size of the semaphore set. |
[in] | permission | Permission to the semaphore set. |
IDATA VMCALL hyshsem_post | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle * | handle, | |||
UDATA | semset, | |||
UDATA | flag | |||
) |
post operation increments the counter in the semaphore by 1 if there is no one in wait for the semaphore.
if there are other processes suspended by wait then one of them will become runnable and the counter remains the same.
[in] | portLibrary | The port library. |
[in] | handle | Semaphore set handle. |
[in] | semset | The no of semaphore in the semaphore set that you want to post. |
[in] | flag | The semaphore operation flag:
|
IDATA VMCALL hyshsem_setVal | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle * | handle, | |||
UDATA | semset, | |||
IDATA | value | |||
) |
setting the value of the semaphore specified in semset.
This function uses no synchronisation prmitives
[in] | portLibrary | The port Library. |
[in] | handle | Semaphore set handle. |
[in] | semset | The no of semaphore in the semaphore set that you want to post. |
[in] | value | The value that you want to set the semaphore to |
void VMCALL hyshsem_shutdown | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary shutdown.
This function is called during shutdown of the portLibrary. Any resources that were created by hyshsem_startup should be destroyed here.
[in] | portLibrary | The port library. |
I_32 VMCALL hyshsem_startup | ( | struct HyPortLibrary * | portLibrary | ) |
PortLibrary startup.
This function is called during startup of the portLibrary. Any resources that are required for the file operations may be created here. All resources created here should be destroyed in hyshsem_shutdown.
[in] | portLibrary | The port library. |
IDATA VMCALL hyshsem_wait | ( | struct HyPortLibrary * | portLibrary, | |
struct hyshsem_handle * | handle, | |||
UDATA | semset, | |||
UDATA | flag | |||
) |
Wait operation decrements the counter in the semaphore set if the counter > 0 if counter == 0 then the caller will be suspended.
[in] | portLibrary | The port library. |
[in] | handle | Semaphore set handle. |
[in] | semset | The no of semaphore in the semaphore set that you want to post. |
[in] | flag | The semaphore operation flag:
|
Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.