Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctThrdDetach

Clean up the FairCom DB 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 FairCom DB Error Codes for a complete listing of valid FairCom DB 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, ctThrdAttach

TOCIndex