Skip to content

Commit

Permalink
EmbeddedEventLoop/Channel: check correct thread (#2951)
Browse files Browse the repository at this point in the history
### Motivation:

`EmbeddedChannel` & `EmbeddedEventLoop` currently violate `Sendable`.
They should store the current thread in `init` and then implement
`inEventLoop` and other functions with a check that the current thread
is correct.
Since NIO 1.0 `Embedded*` were always documented to not be thread-safe
but we should finally police this.

### Modifications:

- Implement the thread check
- For now, just warn (soon hopefully crash)
- Delete EmbeddedScheduledCallbackTests (#2950)

### Result:

- Less Embedded* abuse
- fixes #2949
  • Loading branch information
weissi authored Oct 25, 2024
1 parent 9140817 commit 1ff5fd5
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 55 deletions.
Loading

0 comments on commit 1ff5fd5

Please sign in to comment.