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
basic: duplicate worker threads after a quick pause/resume #38
startListener() starts 4 plain Threads that loop while (listener). onPause() sets listener = false, and onResume() sets it back to true and starts 4 new threads. The flags listener and activeStream are not volatile, and nothing waits for the old threads to exit.
If the app is resumed before every old thread has seen listener == false (a network thread blocked in a 1 s read, a quick screen off/on), the old threads keep running next to the new ones. Two network threads connect to the camera, and two decode threads feed the same decoder. Because the flags are not volatile, a thread may also never see the change at all.
Fix: use a generation counter (as v2 does) or an executor that is shut down and awaited, and make the flags volatile.
Activity
compot-dev commentedon Oct 12, 2026
Fixed in #41 (merged into
basicas 6cf68b5). Not closed automatically becausebasicis not the default branch.