You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
StreamPollFeeder.done should be volatile (thread may hang) #385
StreamPollFeeder.done (line 40) is not declared volatile, but is read in run() outside any synchronized block (line 61) while being written in waitUntilDone() inside synchronized (lock) (line 107).
When the run() thread is actively reading data (input.available() > 0 is continuously true), it never enters the synchronized (lock) block where the lock's happens-before would provide visibility. So waitUntilDone() setting done = true may never be seen by the run() thread, causing it to loop forever — and waitUntilDone()'s subsequent join() call hangs too.
Activity