pjsip logo pjsip.org
Open source SIP stack and media stack for presence, im/instant messaging, and multimedia communication

HOME

SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port

FAQ

Documentation

Licensing

Download

Development (Trac)

Projects using pjsip

Mailing List

Open Source Links


About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono
<bennylp@pjsip.org>


 

Home --> Documentations --> PJLIB Reference

Critical sections.
[Operating System Dependent Functionality.]


Detailed Description

Critical section protection can be used to protect regions where:
  • mutual exclusion protection is needed.
  • it's rather too expensive to create a mutex.
  • the time spent in the region is very very brief.

Critical section is a global object, and it prevents any threads from entering any regions that are protected by critical section once a thread is already in the section.

Critial section is not recursive!

Application MUST NOT call any functions that may cause current thread to block (such as allocating memory, performing I/O, locking mutex, etc.) while holding the critical section.


Functions

void pj_enter_critical_section (void)
void pj_leave_critical_section (void)


Function Documentation

void pj_enter_critical_section ( void   ) 

Enter critical section.

void pj_leave_critical_section ( void   ) 

Leave critical section.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
(C)2001-2008 Benny Prijono