From 9a4c8b80f389346c8f84830ed0143994c21a5663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Flemstr=C3=B6m?= Date: Thu, 31 Oct 2024 11:29:20 +0100 Subject: [PATCH] native_layer: Draw the rest of the owl --- crates/layer/src/native_layer.rs | 15 ++++++++++++--- crates/layer/tests/kitchen_sink.rs | 5 ++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/crates/layer/src/native_layer.rs b/crates/layer/src/native_layer.rs index f82194b..0f96381 100644 --- a/crates/layer/src/native_layer.rs +++ b/crates/layer/src/native_layer.rs @@ -20,7 +20,10 @@ use crate::{debug_annotations, error, ffi_utils, flavor, ids, init}; /// system-level events. #[derive(Clone)] #[repr(transparent)] -pub struct NativeLayer { +pub struct NativeLayer +where + W: for<'w> fmt::MakeWriter<'w>, +{ inner: sync::Arc>, } @@ -43,7 +46,10 @@ struct ThreadLocalCtx { descriptor_sent: atomic::AtomicBool, } -struct Inner { +struct Inner +where + W: for<'w> fmt::MakeWriter<'w>, +{ // Mutex is held during start, stop, flush, and poll ffi_session: sync::Arc>>>, writer: sync::Arc, @@ -761,7 +767,10 @@ where } } -impl Drop for Inner { +impl Drop for Inner +where + W: for<'w> fmt::MakeWriter<'w>, +{ fn drop(&mut self) { let _ = self.flush(self.drop_flush_timeout, self.drop_poll_timeout); let _ = self.stop(); diff --git a/crates/layer/tests/kitchen_sink.rs b/crates/layer/tests/kitchen_sink.rs index c035c28..91959f5 100644 --- a/crates/layer/tests/kitchen_sink.rs +++ b/crates/layer/tests/kitchen_sink.rs @@ -76,7 +76,10 @@ data_sources: time::sleep(time::Duration::from_secs(1)).await; drop(enter); - perfetto_layer.flush(time::Duration::from_millis(1000))?; + perfetto_layer.flush( + time::Duration::from_millis(1000), + time::Duration::from_millis(1000), + )?; drop(demo_span); drop(guard); perfetto_layer.stop()?;