FairCom Corporation


F.78 ctThrdSemapInit


Initialize a semaphore.

Short Name

ctThrdSemapInit

TYPE

Threading function

DECLARATION

NINT ctThrdSemapInit(pctSEMAP semap, NINT count)

DESCRIPTION

A semaphore is a synchronization object that may be acquired by more than one thread at a time, and may be released by a thread that has not acquired it. The count parameter specifies the maximum number of threads that may acquire it simultaneously. The semap parameter is the address of an object of type ctSEMAP.

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful function.
10
SPAC_ERR
Too much space required.
639
TZRO_ERR
count < 1.
640
TINT_ERR
Semaphore already initialized.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

LIMITATIONS

Can only be used with a ctThrd library.

SEE ALSO

ctThrdSemapCls, ctThrdSemapGet, ctThrdSemapRel, and ctThrdSemapTry.


FairCom Corporation
www.faircom.com