# Use \`Mutex\` instead of a \`RefCell\` to acquire/release instance buffers \(\#7291\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 659423a4a1fabc7a0e5af10a2f5954b9e2d27089

Requested commit: 659423a4a1fabc7a0e5af10a2f5954b9e2d27089

Commit: 659423a4a1fabc7a0e5af10a2f5954b9e2d27089

Tree: 25f44020d7bd29239e091274417692a4452883d8

Author: Antonio Scandurra

Committer: GitHub

## Message

```
Use `Mutex` instead of a `RefCell` to acquire/release instance buffers (#7291)

This fixes a panic happening when releasing an instance buffer.
Releasing the buffer happens on a different thread but the borrow
checker was not catching it because the metal buffer completion handler
API doesn't have a `Send` marker on it.

Release Notes:

- N/A
```

## Parents

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

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