Bug 1748945 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I think the `@AnyThread` in there is a mistake, I don't think we can reliably tell a consumer if a session is open on a background thread. Even with synchronized access to `mWindow` code like this will always be broken on a background thread:

```
        if (!session.isOpen()) {
          session.open(sGeckoRuntime);
        }
```

because another thread could open the `session` between the `isOpen()` and the `session.open` statements.
I think the `@AnyThread` in there is a mistake, I don't think we can reliably tell a consumer if a session is open on a background thread. Even with synchronized access to `mWindow` code like this will always be broken on a background thread:

```
        if (!session.isOpen()) {
          session.open(sGeckoRuntime);
        }
```

because another thread could open the `session` between the `isOpen()` and the `session.open` statements.

We should just change `isOpen` to `UiThread` and verify that all calls actually happen on the UI thread.
I think the `@AnyThread` in there is a mistake, I don't think we can reliably tell a consumer if a session is open on a background thread. Even with synchronized access to `mWindow` code like this will always be broken on a background thread:

```
        if (!session.isOpen()) {
          session.open(sGeckoRuntime);
        }
```

because another thread could open the `session` between the `isOpen()` and the `session.open` statements.

We should just change `isOpen` to `@UiThread` and verify that all calls actually happen on the UI thread.

Back to Bug 1748945 Comment 1