示例#1
0
/**
 * Notifies all threads which are waiting on the monitor.
 *
 * Each thread from the set of threads waiting on the
 * object's monitor is waked up.
 *
 * @param[in] mon_ptr monitor
 */
IDATA VMCALL jthread_raw_monitor_notify_all(jrawMonitorID mon_ptr)
{
    hythread_monitor_t monitor =
         (hythread_monitor_t)array_get(jvmti_monitor_table, (UDATA)mon_ptr);
    if (!monitor) {
        return TM_ERROR_INVALID_MONITOR;
    }
    return hythread_monitor_notify_all(monitor);
} // jthread_raw_monitor_notify_all
示例#2
0
/**
 * Signals all threads blocking on the given thin monitor.
 * 
 * @param[in] lockword_ptr monitor addr
 */
IDATA hythread_thin_monitor_notify_all(hythread_thin_monitor_t *lockword_ptr) {
    hythread_monitor_t fat_monitor;
    hythread_thin_monitor_t lockword = *lockword_ptr;
    if (IS_FAT_LOCK(lockword)) {
        fat_monitor = locktable_get_fat_monitor(FAT_LOCK_ID(lockword));
        assert(fat_monitor);
        return hythread_monitor_notify_all(fat_monitor); 
    }
    // check if the current thread owns lock
    if (!hythread_owns_thin_lock(tm_self_tls, lockword)) {
        return TM_ERROR_ILLEGAL_STATE;  
    }    
    return TM_ERROR_NONE;
}