Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright headers.
[simgrid.git] / examples / java / async / yield / Yielder.java
1 /* Copyright (c) 2017-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 package async.yield;
7 import org.simgrid.msg.Host;
8 import org.simgrid.msg.Msg;
9 import org.simgrid.msg.Process;
10
11 public class Yielder extends Process {
12   public Yielder (Host host, String name, String[] args) {
13     super(host, name, args);
14   }
15
16   @Override
17   public void main(String[] args) {
18     int yieldsCount = Integer.parseInt(args[0]);
19     for (int i=0; i<yieldsCount; i++)
20         yield();
21     Msg.info("Yielded "+yieldsCount+". Good bye now!");
22   }
23 }