After the data is inserted, a valid flag on the queue entry is set so that the consumer will know that it is OK to use the data. Monitors Monitors consist of code, data, and condition variables. They are protected by a lock which is unique to the monitor. Access to the monitor is mediated by entry procedures . In Mesa, monitors are a type of module, which seems to correspond roughly to an object.
Monitors have internal and external procedures.
External procedures are not protected by the monitor lock, and so may be executed without going through the entry procedure. Internal procedures can only be executed after going through the entry procedure. A wait on a condition variable releases the monitor lock. It is important to note that the monitor lock is not released when an external procedure is invoked. This is because the invariants associated with the monitor are never violated when the monitor lock is not set.