Examples of fairSemaphore


Examples of org.fairsem.fairSemaphore

  public Ports(int size) {
    pa = new ArrayList<Port>(size);
    num_messages = new ArrayList<>(size);
    num_ports = size;

    sem_mutex_send = new fairSemaphore(1);
    sem_receive = new fairSemaphore(0);
    mutex = new fairSemaphore(1);

    for (int i = 0; i < num_ports; i++) {
      pa.add(new Port<T>());
      num_messages.add(0);
    }
View Full Code Here

Examples of org.fairsem.fairSemaphore

  //private fairSemaphore mutex;
  private Object buffer;
  private boolean free;

  public Port() {
    sem_avail = new fairSemaphore(0);
    //mutex = new fairSemaphore(1);
    sem_continue = new fairSemaphore(0);
    free=true;
    // buffer = new Object();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.