thread th=new thread(()=>{
control.invoke(new Action(()=>{
thread.sleep(5000);
}));
//dosometings
});
th.start();
這個線程裏的dosometings將在5000毫秒後執行,invoke是在異步線程阻塞的,可以阻塞另一個線程,而begininvoke則相反是非阻塞異步執行
thread th=new thread(()=>{
control.invoke(new Action(()=>{
thread.sleep(5000);
}));
//dosometings
});
th.start();
這個線程裏的dosometings將在5000毫秒後執行,invoke是在異步線程阻塞的,可以阻塞另一個線程,而begininvoke則相反是非阻塞異步執行
一、引入相關依賴 可以新建Spring或Maven工程,在pom文件中引入Jedis依賴: <dependencies> <dependency> <groupId>redis.cl