summaryrefslogtreecommitdiff
path: root/extensions/broadcast_channel
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2021-07-06 23:48:01 -0400
committerGitHub <noreply@github.com>2021-07-06 23:48:01 -0400
commit7fc0e8ec8cd4b18ba10a04cf0ac2bee48826de3d (patch)
tree70e078538ae0f3467e8a519b918ae936587ce2d4 /extensions/broadcast_channel
parent78ac19f51f48984ea16f97a0c574fa507544b8d5 (diff)
chore: use parking_lot for synchronization primitives to align with tokio (#11289)
parking_lot is already transitively used in tokio via the "full" cargo feature
Diffstat (limited to 'extensions/broadcast_channel')
-rw-r--r--extensions/broadcast_channel/in_memory_broadcast_channel.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/extensions/broadcast_channel/in_memory_broadcast_channel.rs b/extensions/broadcast_channel/in_memory_broadcast_channel.rs
index 34498c830..879a3dbd5 100644
--- a/extensions/broadcast_channel/in_memory_broadcast_channel.rs
+++ b/extensions/broadcast_channel/in_memory_broadcast_channel.rs
@@ -3,8 +3,8 @@
use crate::BroadcastChannel;
use async_trait::async_trait;
use deno_core::error::AnyError;
+use deno_core::parking_lot::Mutex;
use std::sync::Arc;
-use std::sync::Mutex;
use tokio::sync::broadcast;
use tokio::sync::mpsc;
use uuid::Uuid;
@@ -41,7 +41,7 @@ impl BroadcastChannel for InMemoryBroadcastChannel {
fn subscribe(&self) -> Result<Self::Resource, AnyError> {
let (cancel_tx, cancel_rx) = mpsc::unbounded_channel();
- let broadcast_rx = self.0.lock().unwrap().subscribe();
+ let broadcast_rx = self.0.lock().subscribe();
let rx = tokio::sync::Mutex::new((broadcast_rx, cancel_rx));
let uuid = Uuid::new_v4();
Ok(Self::Resource {
@@ -64,7 +64,7 @@ impl BroadcastChannel for InMemoryBroadcastChannel {
let name = Arc::new(name);
let data = Arc::new(data);
let uuid = resource.uuid;
- self.0.lock().unwrap().send(Message { name, data, uuid })?;
+ self.0.lock().send(Message { name, data, uuid })?;
Ok(())
}