WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

Functions

pj_status_t pj_event_create (pj_pool_t *pool, const char *name, pj_bool_t manual_reset, pj_bool_t initial, pj_event_t **event)
 
pj_status_t pj_event_wait (pj_event_t *event)
 
pj_status_t pj_event_trywait (pj_event_t *event)
 
pj_status_t pj_event_set (pj_event_t *event)
 
pj_status_t pj_event_pulse (pj_event_t *event)
 
pj_status_t pj_event_reset (pj_event_t *event)
 
pj_status_t pj_event_destroy (pj_event_t *event)
 

Detailed Description

This module provides abstraction to event object (e.g. Win32 Event) where available. Event objects can be used for synchronization among threads.

Function Documentation

◆ pj_event_create()

pj_status_t pj_event_create ( pj_pool_t pool,
const char *  name,
pj_bool_t  manual_reset,
pj_bool_t  initial,
pj_event_t **  event 
)

Create event object.

Parameters
poolThe pool.
nameThe name of the event object (for logging purpose).
manual_resetSpecify whether the event is manual-reset
initialSpecify the initial state of the event object.
eventPointer to hold the returned event object.
Returns
event handle, or NULL if failed.

◆ pj_event_destroy()

pj_status_t pj_event_destroy ( pj_event_t event)

Destroy the event object.

Parameters
eventThe event object.
Returns
zero if successfull.

◆ pj_event_pulse()

pj_status_t pj_event_pulse ( pj_event_t event)

Set the event object to signaled state to release appropriate number of waiting threads and then reset the event object to non-signaled. For manual-reset event, this function will release all waiting threads. For auto-reset event, this function will only release one waiting thread.

Parameters
eventThe event object.
Returns
zero if successfull.

◆ pj_event_reset()

pj_status_t pj_event_reset ( pj_event_t event)

Set the event object state to non-signaled.

Parameters
eventThe event object.
Returns
zero if successfull.

◆ pj_event_set()

pj_status_t pj_event_set ( pj_event_t event)

Set the event object state to signaled. For auto-reset event, this will only release the first thread that are waiting on the event. For manual reset event, the state remains signaled until the event is reset. If there is no thread waiting on the event, the event object state remains signaled.

Parameters
eventThe event object.
Returns
zero if successfull.

◆ pj_event_trywait()

pj_status_t pj_event_trywait ( pj_event_t event)

Try wait for event object to be signalled.

Parameters
eventThe event object.
Returns
zero if successfull.

◆ pj_event_wait()

pj_status_t pj_event_wait ( pj_event_t event)

Wait for event to be signaled.

Parameters
eventThe event object.
Returns
zero if successfull.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.