This Section provides details on the functions making up the FairCom Threading API. Note the following points:
ctThrdInit() must be called before any FairCom DB API calls, including initialization.
FairCom DB must be initialized in each thread individually, and only in threads created with ctThrdCreate() or attached with ctThrdAttach().
The ctThrd API and the Instance API (RegisterCtree(), etc.) are not compatible in Multithreaded Standalone model. Each thread should contain exactly one instance of FairCom DB. This is not an issue with the Multithreaded Client model.
Functions specifying a time interval may use ctNOWAIT to indicate a zero interval and ctWAITFOREVER to indicate an indefinite interval.
Unless stated otherwise, a return of zero indicates success. uerr_cod is not set by these functions, however sysiocod is set when unexpected threading errors occur.
To override the default stack size defined in ctatrd.h, add the following code to ctoptn.h, FairCom DB Option Header, or your application before any FairCom DB headers are included. If adding to ctoptn.h, recall that ctoptn.h is dynamically created during execution of the make file created by m-tree, ctree.mak. If changes are to be made to ctoptn.h, be sure the changes are made to the ctoptn.h creation logic at the end of the make file ctree.mak.
#define ctAppSTACKSIZE stack_size
The following error codes are particularly relevant to the threading API: