能通过这座桥的只有一个人

    1. package two.single;
    2. /**
    3. * @author chenxinwei
    4. * @date 2021/2/22 15:27
    5. **/
    6. public class Main {
    7. public static void main(String[] args) {
    8. System.out.println("Testing Gate, hit ctrl + c to exit");
    9. Gate gate = new Gate();
    10. new UserThread(gate,"Alice","Alaska").start();
    11. new UserThread(gate,"Bobby","Brazil").start();
    12. new UserThread(gate,"Chris","Canda").start();
    13. }
    14. }