# Path: pyjvm/jvmo.py
# class JArray(object):
#     '''Java array
# 
#     Lives in heap and has corresponding java_class
#     '''
#     def __init__(self, jc, vm):
#         self.java_class = jc
#         self.fields = {}
#         self.values = []
# 
# Path: pyjvm/thread.py
# class SkipThreadCycle(Exception):
#     '''Thread may skip his execution quota in case when a monitor
#     is busy or sleep was called
#     '''
#     pass


from pyjvm.jvmo import JArray
from pyjvm.thread import SkipThreadCycle
        if t.sleep_until > 0:
            now = int(time.time()) * 1000
            if now <= t.sleep_until:
                if "@monitor" in o.fields:
                    frame.stack.append(ref)
                    frame.stack.append(waiting_time)
                    raise SkipThreadCycle()
                else:
                    o.waiting_list.remove(t)
                    o.fields["@monitor"] = t
                    o.fields["@monitor_count"] = t.monitor_count_cache
                    t.is_notified = False
                    t.waiting_notify = False
                    return
        frame.stack.append(ref)
        frame.stack.append(waiting_time)
        raise SkipThreadCycle()
    else:
        assert "@monitor" in o.fields
        assert o.fields["@monitor"] == frame.thread
        o.waiting_list.append(t)
        t.waiting_notify = True
        if waiting_time[1] > 0:
            now = int(time.time()) * 1000
            t.sleep_until = now + waiting_time[1]
        t.monitor_count_cache = o.fields["@monitor_count"]
        del o.fields["@monitor"]
        del o.fields["@monitor_count"]
        frame.stack.append(ref)
        frame.stack.append(waiting_time)

# Path: pyjvm/jvmo.py
# class JArray(object):
#     '''Java array
# 
#     Lives in heap and has corresponding java_class
#     '''
#     def __init__(self, jc, vm):
#         self.java_class = jc
#         self.fields = {}
#         self.values = []
# 
# Path: pyjvm/thread.py
# class SkipThreadCycle(Exception):
#     '''Thread may skip his execution quota in case when a monitor
#     is busy or sleep was called
#     '''
#     pass


# Path: pyjvm/platform/java/lang/object.py
from pyjvm.jvmo import JArray
from pyjvm.thread import SkipThreadCycle

        if t.sleep_until > 0:
            now = int(time.time()) * 1000
            if now <= t.sleep_until:
                if "@monitor" in o.fields:
                    frame.stack.append(ref)
                    frame.stack.append(waiting_time)
                    raise SkipThreadCycle()
                else:
                    o.waiting_list.remove(t)
                    o.fields["@monitor"] = t
                    o.fields["@monitor_count"] = t.monitor_count_cache
                    t.is_notified = False
                    t.waiting_notify = False
                    return
        frame.stack.append(ref)
        frame.stack.append(waiting_time)
        raise SkipThreadCycle()
    else:
        assert "@monitor" in o.fields
        assert o.fields["@monitor"] == frame.thread
        o.waiting_list.append(t)
        t.waiting_notify = True
        if waiting_time[1] > 0:
            now = int(time.time()) * 1000
            t.sleep_until = now + waiting_time[1]
        t.monitor_count_cache = o.fields["@monitor_count"]
        del o.fields["@monitor"]
        del o.fields["@monitor_count"]
        frame.stack.append(ref)
        frame.stack.append(waiting_time)

        raise SkipThreadCycle()