1608 }
1609
1610
1611 static jvmtiError
1612 installHandler(HandlerNode *node,
1613 HandlerFunction func,
1614 jboolean external)
1615 {
1616 jvmtiError error;
1617
1618 if ( func == NULL ) {
1619 return AGENT_ERROR_INVALID_EVENT_TYPE;
1620 }
1621
1622 debugMonitorEnter(handlerLock);
1623
1624 HANDLER_FUNCTION(node) = func;
1625
1626 node->handlerID = external? ++requestIdCounter : 0;
1627 error = eventFilterRestricted_install(node);
1628 if (error == JVMTI_ERROR_NONE) {
1629 insert(getHandlerChain(node->ei), node);
1630 }
1631
1632 debugMonitorExit(handlerLock);
1633
1634 return error;
1635 }
1636
1637 static HandlerNode *
1638 createInternal(EventIndex ei, HandlerFunction func,
1639 jthread thread, jclass clazz, jmethodID method,
1640 jlocation location, jboolean permanent)
1641 {
1642 jint index = 0;
1643 jvmtiError error = JVMTI_ERROR_NONE;
1644 HandlerNode *node;
1645
1646 /*
1647 * Start with necessary allocations
|
1608 }
1609
1610
1611 static jvmtiError
1612 installHandler(HandlerNode *node,
1613 HandlerFunction func,
1614 jboolean external)
1615 {
1616 jvmtiError error;
1617
1618 if ( func == NULL ) {
1619 return AGENT_ERROR_INVALID_EVENT_TYPE;
1620 }
1621
1622 debugMonitorEnter(handlerLock);
1623
1624 HANDLER_FUNCTION(node) = func;
1625
1626 node->handlerID = external? ++requestIdCounter : 0;
1627 error = eventFilterRestricted_install(node);
1628 if (node->ei == EI_GC_FINISH) {
1629 classTrack_activate(getEnv());
1630 }
1631 if (error == JVMTI_ERROR_NONE) {
1632 insert(getHandlerChain(node->ei), node);
1633 }
1634
1635 debugMonitorExit(handlerLock);
1636
1637 return error;
1638 }
1639
1640 static HandlerNode *
1641 createInternal(EventIndex ei, HandlerFunction func,
1642 jthread thread, jclass clazz, jmethodID method,
1643 jlocation location, jboolean permanent)
1644 {
1645 jint index = 0;
1646 jvmtiError error = JVMTI_ERROR_NONE;
1647 HandlerNode *node;
1648
1649 /*
1650 * Start with necessary allocations
|