001/*
002 *  This file is part of the Jikes RVM project (http://jikesrvm.org).
003 *
004 *  This file is licensed to You under the Eclipse Public License (EPL);
005 *  You may not use this file except in compliance with the License. You
006 *  may obtain a copy of the License at
007 *
008 *      http://www.opensource.org/licenses/eclipse-1.0.php
009 *
010 *  See the COPYRIGHT.txt file distributed with this work for information
011 *  regarding copyright ownership.
012 */
013package org.mmtk.vm;
014
015import org.vmmagic.pragma.Uninterruptible;
016
017/**
018 * Provides MMTk access to a heavy lock with condition variable.
019 * Functionally similar to Java monitors, but safe in the darker corners of runtime code.
020 */
021@Uninterruptible
022public abstract class Monitor {
023
024  /**
025   * Block until the lock is acquired.
026   */
027  public abstract void lock();
028
029  /**
030   * Release the lock.
031   */
032  public abstract void unlock();
033
034  /**
035   * Wait for a broadcast.
036   */
037  public abstract void await();
038
039  /**
040   * Send a broadcast.
041   */
042  public abstract void broadcast();
043}