package com.lovecoding.day14.thread04;

public class TestDiningHome {

    public static void main(String[] args) {

        //餐厅
        DiningHome diningHome = new DiningHome();

        new Thread( ()->{
            while (true){
                diningHome.put();
            }
        },"厨师").start();
        new Thread( ()->{
            while (true){
                diningHome.put();
            }
        },"厨师").start();

        new Thread( ()->{
            while (true){
                diningHome.take();
            }
        },"服务员").start();
        new Thread( ()->{
            while (true){
                diningHome.take();
            }
        },"服务员").start();

    }
}