mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
[core] Use lock::RwLock in Registry.
This commit is contained in:
1 parent
36e0a135f5
commit
927b7e96fe
2 files changed
+3
-2
No files matched your search
@@ -142,6 +142,7 @@ define_lock_ranks! {
|
||||
rank DEVICE_TRACKERS "Device::trackers" followed by { }
|
||||
rank DEVICE_USAGE_SCOPES "Device::usage_scopes" followed by { }
|
||||
rank IDENTITY_MANAGER_VALUES "IdentityManager::values" followed by { }
|
||||
rank REGISTRY_STORAGE "Registry::storage" followed by { }
|
||||
rank RESOURCE_POOL_INNER "ResourcePool::inner" followed by { }
|
||||
rank SHARED_TRACKER_INDEX_ALLOCATOR_INNER "SharedTrackerIndexAllocator::inner" followed by { }
|
||||
rank STAGING_BUFFER_RAW "StagingBuffer::raw" followed by { }
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use parking_lot::{RwLock, RwLockReadGuard, RwLockWriteGuard};
|
||||
use wgt::Backend;
|
||||
|
||||
use crate::{
|
||||
id::Id,
|
||||
identity::IdentityManager,
|
||||
lock::{rank, RwLock, RwLockReadGuard, RwLockWriteGuard},
|
||||
resource::Resource,
|
||||
storage::{Element, InvalidId, Storage},
|
||||
};
|
||||
@@ -48,7 +48,7 @@ impl<T: Resource> Registry<T> {
|
||||
pub(crate) fn new(backend: Backend) -> Self {
|
||||
Self {
|
||||
identity: Arc::new(IdentityManager::new()),
|
||||
storage: RwLock::new(Storage::new()),
|
||||
storage: RwLock::new(rank::REGISTRY_STORAGE, Storage::new()),
|
||||
backend,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user