Lines Matching full:monitor
27 * Every Object has a monitor associated with it, but not every Object is
29 * full-fledged monitor until a) there is actual contention or b) wait()
66 * Only one thread can own the monitor at any time. There may be several
70 * TODO: the various members of monitor are not SMP-safe.
72 struct Monitor {
77 Thread* waitSet; /* threads currently waiting on this monitor */
81 Monitor* next;
84 * Who last acquired this monitor, when lock sampling is enabled.
93 * Create and initialize a monitor.
95 Monitor* dvmCreateMonitor(Object* obj)
97 Monitor* mon;
99 mon = (Monitor*) calloc(1, sizeof(Monitor));
101 ALOGE("Unable to allocate monitor");
107 /* replace the head of the list with the new monitor */
117 * Free the monitor list. Only used when shutting the VM down.
121 Monitor* mon;
122 Monitor* nextMon;
133 * Get the object that a monitor is part of.
135 Object* dvmGetMonitorObject(Monitor* mon)
194 * Free the monitor associated with an object and make the object's lock
197 static void freeMonitor(Monitor *mon)
217 * Frees monitor objects belonging to unmarked objects.
219 void dvmSweepMonitorList(Monitor** mon, int (*isUnmarkedObject)(void*))
221 Monitor handle;
222 Monitor *prev, *curr;
341 * Lock a monitor.
343 static void lockMonitor(Thread* self, Monitor* mon)
393 // When debugging, save the current monitor holder for future
411 * Try to lock a monitor.
416 static bool tryLockMonitor(Thread* self, Monitor* mon)
434 * Unlock a monitor.
439 static bool unlockMonitor(Thread* self, Monitor* mon)
445 * We own the monitor, so nobody else can be in here.
461 dvmThrowIllegalMonitorStateException("unlock of unowned monitor");
472 static int waitSetCheck(Monitor *mon)
492 * Links a thread into a monitor's wait set. The monitor lock must be
495 static void waitSetAppend(Monitor *mon, Thread *thread)
516 * Unlinks a thread from a monitor's wait set. The monitor lock must
519 static void waitSetRemove(Monitor *mon, Thread *thread)
594 * Wait on a monitor until timeout, interrupt, or notification. Used for
616 static void waitMonitor(Thread* self, Monitor* mon, s8 msec, s4 nsec,
653 * Add ourselves to the set of threads waiting on this monitor, and
659 * the monitor. Aside from that, the order of member updates is
685 * Set waitMonitor to the monitor object we will be waiting on.
704 * Release the monitor lock and wait for a notification or
729 /* Reacquire the monitor lock. */
736 * thread owns the monitor. Aside from that, the order of member
764 * Notify one thread waiting on this monitor.
766 static void notifyMonitor(Thread* self, Monitor* mon)
796 * Notify all threads waiting on this monitor.
798 static void notifyAllMonitor(Thread* self, Monitor* mon)
826 * Changes the shape of a monitor from thin to fat, preserving the
831 Monitor *mon;
838 /* Allocate and acquire a new monitor. */
1044 dvmThrowIllegalMonitorStateException("unlock of unowned monitor");
1069 Monitor* mon;
1160 * easiest to just sleep on a private Monitor.
1168 Monitor* mon = gDvm.threadSleepMon;
1208 * is only set when a thread actually waits on a monitor,
1209 * which implies that the monitor has already been fattened.
1301 * The monitor lock has been acquired. Change the