Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid taking a write lock in
RegisteredType::{root,clone,drop}
By moving the registration count into the `Arc`, that is pulling the `Arc` outwards from containing just the `WasmFuncType` to the registration count as well, and turning it into an atomic, we can manipulate the registration count without a write lock. Once that is done, we have the following: * `RegisteredType::root` only needs a read lock, not a write lock. * `RegisteredType::clone`, which used to need a write lock, doesn't need any locking anymore. * `RegisteredType::drop` doesn't need any locking most of the time. The exception is when this is this drop that moves the refcount to zero, in which case grabbing a write lock is still necessary to remove the type from the registry.
- Loading branch information