Sun Java System Web Server 7.0 Update 7 NSAPI Developer's Guide

crit_init() Function

The crit_init function is a critical-section function that creates and returns a new critical-section variable, a variable of type CRITICAL. Use this function to obtain a new instance of a variable of type CRITICAL, a critical-section variable. Use this variable to prevent interference between two threads of execution. At the time this variable is created, no thread owns the critical section.


Caution – Caution –

Threads must not own or be waiting for the critical section when crit_terminate is called.


Syntax

CRITICAL crit_init(void);

Return Values

A newly allocated critical-section variable (CRITICAL).

Parameters

none

See Also

crit_enter() Function, crit_exit() Function, crit_terminate() Function