Sun Microsystems 2 Wireless Office Headset User Manual


 
18 Multitasking Guide May 2007
} else {
/* this is a reinvocation after having been awakened */
statusp =
(MWSTATUS *)KNI_GetIntField(thisObj, nativePtrFieldID);
retval = (int)(*statusp);
KNI_SetIntField(thisObj, nativePtrFieldID, 0);
free(statusp);
}
KNI_EndHandles();
KNI_ReturnInt(retval);
}
void
callback(MWstatus status, void *context)
{
MWSTATUS *statusp = (MWSTATUS *)context;
*statusp = status;
/*
* Search the list of block threads and find the right
* one to unblock with SNI_UnblockThread(). See the CLDC HI
* Porting Guide for further information.
*/
}
KNIEXPORT KNI_RETURNTYPE_INT
Java_javax_microwave_oven_Microwave_finalize(void)
{
jfieldID nativePtrFieldID;
MWSTATUS *statusp;
KNI_StartHandles(2);
KNI_DeclareHandle(thisObj);
KNI_DeclareHandle(microwaveClass);
KNI_GetThisPointer(thisObj);
KNI_GetObjectClass(thisObj, microwaveClass);
nativePtrFieldID =
KNI_GetFieldID(microwaveClass, "nativePtr", "I");
statusp = (MWSTATUS *)KNI_GetIntField(thisObj, nativePtrFieldID);
if (statusp != NULL) {
free(statusp);
KNI_SetIntField(thisObj, nativePtrFieldID, 0);
}
}