PK_THREAD_tidy   

PK_ERROR_code_t PK_THREAD_tidy
(
void
)


This function ensures that Parasolid is in a valid state for the calling
thread whenever a longjump is made.


Specific Errors:
    PK_ERROR_bad_thread         called from an internal Parasolid thread
    PK_ERROR_fatal_error        unable to restore thread to a valid state


This function must be called before further PK function calls whenever
an error handler or memory allocator longjumps back to application code
instead of returning control to Parasolid. This resets the state of the
PK to its initial settings for the calling thread, and tidies up internal
memory. Any other application threads inside Parasolid are unaffected.

PK_THREAD_tidy may be called before or after the longjump.

If PK_THREAD_tidy is called from an internal Parasolid thread, then it
will return the error code PK_ERROR_bad_thread, without raising a PK error
condition. Applications should return control to Parasolid from the error
handler or memory allocator in this case.

If PK_THREAD_tidy is unable to restore Parasolid to a valid state then it
will return the error code PK_ERROR_fatal_error but it will not raise a PK
error condition.

PK_THREAD_tidy can be called at any time when a PK function is not active
in the calling thread.