JAVA同步之ReentrantLock可中斷鎖的使用

http://www.iteedu.com/plang/java/superjava/threadsafe/lockInterruptibly.phpphp 之前咱們用java synchronized (mutex) { 。。。。。。。 } spa 進行同步時必須等待別的線程釋放鎖後才能進入同步塊,如今問題時當太長時間等待時不想再等了,怎麼辦?線程 ReentrantLock爲咱們實現了中斷等待
相關文章
相關標籤/搜索