Ticket12306LockTest.java 464 字节
Newer Older
1 2
package com.kwan.shuyu;

3 4 5 6 7 8 9 10 11

/**
 * InterProcessMutex 分布式锁测试
 *
 * @author : qinyingjie
 * @version : 2.2.0
 * @date : 2023/5/15 09:53
 */
public class Ticket12306LockTest {
12 13 14 15 16 17 18 19 20
    public static void main(String[] args) {
        Ticket12306 ticket12306 = new Ticket12306();
        //创建客户端
        Thread t1 = new Thread(ticket12306, "携程");
        Thread t2 = new Thread(ticket12306, "飞猪");
        t1.start();
        t2.start();
    }
}