Calling a lambda expression from a new thread before the main method is run causes the thread to lock up
Luke Hutchison
luke.hutch at gmail.com
Tue Jan 24 07:52:10 UTC 2017
On Mon, Jan 23, 2017 at 11:37 PM, Luke Hutchison <luke.hutch at gmail.com>
wrote:
> On Mon, Jan 23, 2017 at 11:21 PM, Luke Hutchison <luke.hutch at gmail.com>
> wrote:
>
>> That looks like a variation of the classic class initialization deadlock
>>> problem. Your main thread is blocked in es.submit(callable).get(); while
>>> still within the static initializer of the LambdaBug class. If the executor
>>> thread also needs to ensure LambdaBug is initialized (which it will in the
>>> lambda case) then it will wait for the main thread to complete the
>>> initialization. Hence deadlock.
>>
>>
PS I submitted a bug report before finding core-libs-dev, and that bug was
just posted to Jira:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8173252
More information about the core-libs-dev
mailing list