Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

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 FairCom DB Error Codes for a complete listing of valid FairCom DB error values.

Limitations

Can only be used with a ctThrd library.

See also

ctThrdSemapCls, ctThrdSemapGet, ctThrdSemapRel, ctThrdSemapTry

TOCIndex