Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# OsclSemaphore Class Reference

`#include <oscl_semaphore.h>`

## Public Methods
OSCL_IMPORT_REF | OsclSemaphore ()
OSCL_IMPORT_REF | ~OsclSemaphore ()
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | Create (uint32 initVal=0)
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | Close ()
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | Wait ()
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | Wait (uint32 timeout_msec)
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | TryWait ()
OSCL_IMPORT_REF OsclProcStatus::eOsclProcError | Signal ()

## Detailed Description

Class Semaphore

## Constructor & Destructor Documentation

OSCL_IMPORT_REF OsclSemaphore::OsclSemaphore | ( |  | ) |

| Class constructor

OSCL_IMPORT_REF OsclSemaphore::~OsclSemaphore | ( |  | ) |

| Class destructor

## Member Function Documentation

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::Close | ( |  | ) |

  | Closes the Semaphore Parameters:
  It | wont take any parameters
Returns: Returns the Error whether it is success or failure incase of failure it will return what is the specific error

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::Create | ( | uint32 | initVal = 0 | ) |

  | Creates the Semaphore Parameters:
  Intialcount |
Returns: Returns the Error whether it is success or failure incase of failure it will return what is the specific error

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::Signal | ( |  | ) |

  | Signals that the thread is finished with the Semaphore Parameters:
  It | wont take any parameters
Returns: Returns the Error whether it is success or failure incase of failure it will return what is the specific error

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::TryWait | ( |  | ) |

  | Try to acquire semaphore ,if the semaphore is already acquired by another thread, calling thread immediately returns with out blocking Parameters:
  It | wont take any parameters
Returns: Returns SUCCESS_ERROR if the semaphore was acquired, SEM_LOCKED_ERROR if the semaphore cannot be acquired without waiting, or an error code if the operation failed. Note: this function may not be supported on all platforms, and may return NOT_IMPLEMENTED.

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::Wait | ( | uint32 | timeout_msec | ) |

  | Makes the thread to wait on the Semaphore, with a timeout. Parameters:
  timeout | in milliseconds.
Returns: Returns SUCCESS_ERROR if the semaphore was aquired, WAIT_TIMEOUT_ERROR if the timeout expired without acquiring the semaphore, or an error code if the operation failed. Note: this function may not be supported on all platforms, and may return NOT_IMPLEMENTED.

OSCL_IMPORT_REF OsclProcStatus::eOsclProcError OsclSemaphore::Wait | ( |  | ) |

  | Makes the thread to wait on the Semaphore Parameters:
  It | wont take any parameters
Returns: Returns the Error whether it is success or failure incase of failure it will return what is the specific error

The documentation for this class was generated from the following file:

- oscl_semaphore.h