FairCom Corporation


F.58 ctThrdDetach


Clean up the c-tree Plus compatibility created with ctThrdAttach.

Short Name

ctThrdDetach

TYPE

Threading Function

DECLARATION

NINT ctThrdDetach(void)

DESCRIPTION

If ctThrdDetach is called for a thread made compatible by ctThrdAttach, any memory allocated for control structures is returned.

If ctThrdDetach is called for a thread that was not made compatible by ctThrdAttach, ctThrdDetach does nothing.

Calling ctThrdDetach more than once for the same thread will have no affect.

RETURN

ctThrdDetach always returns NO_ERROR. 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.

EXAMPLE

NINT retval4;
COUNT retval2;
/* Assumes ctThrdInit is called in the main app thread */
NINT SampleThreadFunction( void )
{
if (retval4 = ctThrdAttach()) {
printf("\nError attaching thread: %d", retval4);
return(retval4);
}
if (retval2 = InitISAM(3,50,32)) {
printf("\nError initializing c-tree: %d", retval2);
return(retval2);
}
dbWork();
CloseISAM();
ctThrdDetach();
return(NULL);
}

SEE ALSO

ctThrdInit and ctThrdAttach.


FairCom Corporation
www.faircom.com