java买票问题,高并发,一个人买到多张票怎么统计 晚上才有时间回复

public static void main(String[] args) {
    for (int i = 1; i <=10000; i++) {
        new people(i+"").start();
    }
}

}
class people extends Thread{
private String name;
private static int num=1;
public people(String name) {
super();
this.name = name;
}
public people() {
super();
}
@Override
public void run(){
rod();
}

public void rod() {
    while (true) {
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        synchronized (people.class) {
            if(num<=1000){
                System.out.println("di------"+this.name+"------gerenqiangdaoledi------"+num+"------zhangpiao");
                people.num++;
            }else {
                return;
            }
        }
    }
}

使用map记录key,value就是买到的票