Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void run()
- {
- while(true)
- {
- synchronized (r)
- {
- r.notify();
- if((r.getAktTank()+verhältnis) <= r.getTank() && !r.full)
- {
- r.setTank(verhältnis);
- System.out.println("betankt mit " + r.getAktTank());
- }
- else
- {
- r.full = true;
- break;
- }
- try {
- //System.out.println("wait");
- r.wait();
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement