# extension_host: Fix \`IS_WASM_THREAD\` being set for wrong threads \(\#43005\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/94a43dc73a905f690627812dceb615fcea212900)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 94a43dc73a905f690627812dceb615fcea212900

Requested commit: 94a43dc73a905f690627812dceb615fcea212900

Commit: 94a43dc73a905f690627812dceb615fcea212900

Tree: ab3d9e94674baaee6836a7c7a799131b4c89a6b9

Author: Lukas Wirth

Committer: GitHub

## Message

```
extension_host: Fix `IS_WASM_THREAD` being set for wrong threads (#43005)

https://github.com/zed-industries/zed/pull/40883 implemented this
incorrectly. It was marking a random background thread as a wasm thread
(whatever thread picked up the wasm epoch timer background task),
instead of marking the threads that actually run the wasm extension.

This has two implications:
1. it didn't prevent extension panics from tearing down as planned
2. Worse, it actually made us hide legit panics in sentry for one of our
background workers.

Now 2 still technically applies for all tokio threads after this, but we
basically only use these for wasm extensions in the main zed binary.

Release Notes:

- Fixed extension panics crashing Zed on Linux
```

## Parents

- [e8e0707256547ca5c3601dc2ce0479a406b5197b](https://git.cafe/gitcafe/zed/commit/e8e0707256547ca5c3601dc2ce0479a406b5197b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/94a43dc73a905f690627812dceb615fcea212900?format=markdown)
