ct_clear

The ct_clear function cleans up the data structures internal to Cheap Threads, reinitializing them for possible further use.

Prototype:

void ct_clear( void );

Parameters:

None.

Return Value:

None.

Discussion:

The ct_clear() function destroys all threads, calling any cleanup functions that have been installed for them. Then it sets a series of internal variables to their initial state.

Note that ct_clear() does not restore the default error reporting function.

There are two circumstances when ct_clear() may be useful:

Otherwise, calling ct_clear() is neither necessary nor useful. In particular there is normally no need to call it before or after calling ct_schedule(). In the absence of an error condition, the scheduler performs the equivalent of ct_clear() before returning control to the application.

Restrictions:

The ct_clear() function has no effect if called from a thread or user exit. In other words it should be called only when the scheduler is not running.
Home