我讀Java併發實踐,這裏面的東西我搞糊塗了:newSingleThreadExecutor是否返回由unconfigurableExecutorService包裝的ExecutorService?
執行人包括工廠方法,unconfigurableExecutorService,這需要現有的ExecutorService和一個包裝它僅僅曝光方法的ExecutorService,所以它不能進一步配置。與合併實現不同,newSingleThreadExecutor返回一個以此方式打包的ExecutorService,而不是原始的ThreadPoolExecutor。
我讀過newSingleThreadExecutor的源代碼,但就是怎麼也找不到它是由unconfigurableExecutorService包裹?