LinkedTransferQueue不支持null元素,如果插入null元素將會(huì)拋出NullPointerException異常。 在使用transfer()方法時(shí),如果隊(duì)列已滿或?yàn)榭?調(diào)用transfer()方法的線程將會(huì)被阻塞,直到另一個(gè)線程將元素插入或取走。因此,在使用transfer()方法時(shí)需要注意線程的阻塞問題,避免出現(xiàn)死鎖或線程饑餓的情況。 Lin
www.dbjr.com.cn/program/339933x...htm 2025-6-2