media/libraries
tonihei 0dd43b0183 Reduce 'synchronized' usage in EPII by making variable single thread
EPII currently uses 'synchronized' for two purposes:
 1. `waitUninteruptably` to ensure the condition checks and
    `wait` calls are atomic + the calls on the playback thread
    that update these conditions to `notifyAll`.
 2. Access to the `released` field that is used a condition
    for `waitUninterruptibly` but otherwise only accessed on the
    app thread.

We can remove the second usage by making the `released` variable
more clearly single thread on the app thread (including renaming to
make it obvious as this is the only variable in this class accessed
on that thread). The `waitUninterruptly` call for `release` can use
an `AtomicBoolean` like the other two calls to this method.

This also fixes a potential bug where a release timeout would leave
the `released` field as `false`, meaning future calls to these other
methods wouldn't be blocked early.

PiperOrigin-RevId: 743156035
2025-04-02 08:54:29 -07:00
..
2025-03-31 05:22:31 -07:00
2024-11-04 04:16:39 -08:00