@@ -31,12 +31,11 @@ use libdd_profiling::exporter::Tag;
3131use libdd_profiling:: internal:: Profile as InternalProfile ;
3232use log:: { debug, info, trace, warn} ;
3333use std:: borrow:: Cow ;
34- use std:: cell:: OnceCell ;
3534use std:: collections:: HashMap ;
3635use std:: hash:: Hash ;
3736use std:: num:: NonZeroI64 ;
3837use std:: sync:: atomic:: { AtomicBool , AtomicPtr , AtomicU32 , Ordering } ;
39- use std:: sync:: { Arc , Barrier } ;
38+ use std:: sync:: { Arc , Barrier , OnceLock } ;
4039use std:: thread:: JoinHandle ;
4140use std:: time:: { Duration , Instant , SystemTime , UNIX_EPOCH } ;
4241
@@ -58,7 +57,7 @@ const UPLOAD_CHANNEL_CAPACITY: usize = 8;
5857
5958/// The global profiler. Profiler gets made during the first rinit after an
6059/// minit, and is destroyed on mshutdown.
61- static mut PROFILER : OnceCell < Profiler > = OnceCell :: new ( ) ;
60+ static mut PROFILER : OnceLock < Profiler > = OnceLock :: new ( ) ;
6261
6362/// Order this array this way:
6463/// 1. Always enabled types.
@@ -657,7 +656,7 @@ const DDPROF_TIME: &str = "ddprof_time";
657656const DDPROF_UPLOAD : & str = "ddprof_upload" ;
658657
659658impl Profiler {
660- /// Will initialize the `PROFILER` OnceCell and makes sure that only one thread will do so.
659+ /// Will initialize the `PROFILER` OnceLock and makes sure that only one thread will do so.
661660 pub fn init ( system_settings : & SystemSettings ) {
662661 // SAFETY: the `get_or_init` access is a thread-safe API, and the
663662 // PROFILER is only being mutated in single-threaded phases such as
0 commit comments