The hygp_register_handler function is partially dependent on internal VM structures, and must be called with NULL as a third (userData) parameter.
#include "hyport.h"
#include "hycomp.h"
#include "gp.h"
Functions | |
UDATA VMCALL | hygp_protect (struct HyPortLibrary *portLibrary, protected_fn fn, void *arg) |
Kicks off the new thread by calling the function provided in protected_fn fn. | |
void VMCALL | hygp_register_handler (struct HyPortLibrary *portLibrary, handler_fn fn, void *aUserData) |
Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp. | |
U_32 VMCALL | hygp_info (struct HyPortLibrary *portLibrary, void *info, U_32 category, I_32 index, const char **name, void **value) |
Provides the name and value, specified by category/index of the gp information in info. | |
U_32 VMCALL | hygp_info_count (struct HyPortLibrary *portLibrary, void *info, U_32 category) |
Returns the number of items that exist in the category specified, or zero if the category is undefined. | |
void VMCALL | hygp_shutdown (struct HyPortLibrary *portLibrary) |
PortLibrary shutdown. | |
I_32 VMCALL | hygp_startup (struct HyPortLibrary *portLibrary) |
PortLibrary startup. |
|
Provides the name and value, specified by category/index of the gp information in info. Returns the kind of information found at category/index specified, or undefined if the category/index are invalid. The number of items in the category specified must equal the count hygp_info_count returns for that category.
|
|
Returns the number of items that exist in the category specified, or zero if the category is undefined.
|
|
Kicks off the new thread by calling the function provided in protected_fn fn. All threads spawned by the vm start here and all OS signals that will be handled by fn must be registered to the OS here. Upon receiving a signal from the OS, fn is responsible for calling the function specified in hygp_register_handler if it is determined that a shutdown is required.
|
|
Sets the function that is responsible for preserving/outputting the state of the vm and initiating a graceful shutdown resulting from a gp.
|
|
PortLibrary shutdown. This function is called during shutdown of the portLibrary. Any resources that were created by hygp_startup should be destroyed here.
|
|
PortLibrary startup. This function is called during startup of the portLibrary. Any resources that are required for the shared library operation may be created here. All resources created here should be destroyed in hygp_shutdown.
|