All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.objectweb.dream.synchro.MutexReEntrantItf Maven / Gradle / Ivy

/**
 * Dream
 * Copyright (C) 2003-2004 INRIA Rhone-Alpes
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Contact : [email protected]
 *
 * Initial developer(s): Matthieu Leclercq, Vivien Quema
 * Contributor(s):
 */

package org.objectweb.dream.synchro;

import org.objectweb.fractal.fraclet.annotation.annotations.Interface;

/**
 * A reentrant mutex component aims at synchronizing the execution of several
 * components.
 */
@Interface(name = MutexReEntrantItf.ITF_NAME)
public interface MutexReEntrantItf extends MutexItf
{

  /** The default name of the {@link MutexReEntrantItf }interface. */
  String ITF_NAME = "mutex-reentrant";

  /**
   * Acquires the mutex with parameters that have been returned by a previous
   * call to forceUnlock().
   * 
   * @param o parameters that have been returned by a previous call to
   *          forceUnlock().
   * @throws InterruptedException the thread is interrupted.
   */
  void forceLock(Object o) throws InterruptedException;

  /**
   * Releases the mutex even if it has been acquired several times (by multiple
   * calls to the lock() function). The returned object represents the state of
   * the lock. It must be given as parameter to the forceLock() method if the
   * mutex is to be reacquired later (with the same state).
   * 
   * @return o an object representing the state of the lock.
   */
  Object forceUnlock();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy