cleanup the Maple structures from registered threads

Parameters

 kv - kernel handle of type MKernelVector options - specify which Maple features the thread needs

Description

A user created thread is a thread that was not created by Maple (via Threads:-Create or as part of the Task Programming Model).  For example, threads created when a user calls pthread_create or a similar function.

 • The only Maple external call function usable by an unregistered thread is MapleGetInterruptValue.  No other functions are supported.
 • By calling MapleRegisterThread, Maple creates thread local data structures required to execute various Maple features.  Which structures are created are specified by the options field.

Currently only the MAPLE_ENABLE_GMP option is supported.  This creates the structure necessary to allow MaplePushGMPAllocators and MaplePopGMPAllocators to function properly in the current thread.

 • The MapleUnregisterThread function removes the data structures when the thread is finished using Maple features.
 • On success, MapleRegisterThread and MapleUnregisterThread returns MAPLE_SUCCEEDED.  On failure one of the following error codes are returned:

MAPLE_ERROR_INVALID_OPTIONS: the given options is not valid.