簡體   English   中英

如果調用return,線程是否會釋放鎖定?

[英]Does a thread release lock if return is called?

如標題中所述,在以下情況下,調用return是否釋放了鎖?

public void method(){
    syncronized(lock){
        for(int i=0; i<10; i++)
            if( something.get(i) == something_else)
                return;
    }

    more code...
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM