/**
 * Native finalizer to reset the native peer event queue when
 * the Isolate ends.
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_midp_events_EventQueue_finalize(void) {
   jint queueId;
   EventQueue* pEventQueue;

   KNI_StartHandles(1);
   KNI_DeclareHandle(thisObject);
   KNI_GetThisPointer(thisObject);

   SNI_BEGIN_RAW_POINTERS;
   queueId = getEventQueuePtr(thisObject)->queueId;
   SNI_END_RAW_POINTERS;

   KNI_EndHandles();

   if (queueId >= 0) {
       resetEventQueue(queueId);

       /* Mark queue as inactive */
       GET_EVENT_QUEUE_BY_ID(pEventQueue, queueId);
       pEventQueue->isActive = KNI_FALSE;
   }

   KNI_ReturnVoid();
}
/**
 * Clears native event queue for a given isolate - 
 * there could be some events from isolate's previous usage.
 *
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_midp_events_EventQueue_resetNativeEventQueue(void) {
    jint queueId;

    queueId = KNI_GetParameterAsInt(1);
    resetEventQueue(queueId);
}
/**
 * Resets the all internal event queues, clearing and freeing
 * any pending events.
 */
void
midp_resetEvents(void) {

    /* The Event ID may have changed for each VM startup*/
    eventFieldIDsObtained = KNI_FALSE;

#if ENABLE_MULTIPLE_ISOLATES
    {
        jint queueId;
        for (queueId = 1; queueId < gsTotalQueues; queueId++) {
            resetEventQueue(queueId);
        }
    }
#else
    resetEventQueue(0);
#endif
}
Exemplo n.º 4
0
/**
 * Resets the all internal event queues, clearing and freeing
 * any pending events.
 */
void
midp_resetEvents(void) {
    int i;

    // The Event ID may have changed for each VM startup
    eventFieldIDsObtained = KNI_FALSE;

    for (i = 0; i < maxIsolates; i++) {
        resetEventQueue(i);
    }
}
Exemplo n.º 5
0
/**
 * Native finalizer to reset the native peer event queue when
 * the Isolate ends.
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_midp_events_EventQueue_finalize(void) {
   jint handle;

   KNI_StartHandles(1);
   KNI_DeclareHandle(thisObject);
   KNI_GetThisPointer(thisObject);

   SNI_BEGIN_RAW_POINTERS;
   handle = getEventQueuePtr(thisObject)->nativeEventQueueHandle;
   SNI_END_RAW_POINTERS;

   KNI_EndHandles();

   if (handle >= 0) {
       resetEventQueue(handle);
   }

   KNI_ReturnVoid();
}
Exemplo n.º 6
0
/**
 * Clears native event queue for a given isolate - 
 * there could be some events from isolate's previous usage.
 *
 */
KNIEXPORT KNI_RETURNTYPE_VOID
Java_com_sun_midp_events_EventQueue_resetNativeEventQueue(void) {
    resetEventQueue(getCurrentIsolateId());
}