luaur-repl-cli 0.1.0

Interactive Luau REPL (Rust).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Faithful port of `void profilerStop()` (CLI/src/Profiler.cpp:109).

use core::sync::atomic::Ordering;

use crate::functions::profiler_trigger::G_PROFILER;

pub fn profiler_stop() {
    unsafe {
        let profiler = core::ptr::addr_of_mut!(G_PROFILER).as_mut().unwrap();
        profiler.exit.store(true, Ordering::Relaxed);
        if let Some(handle) = profiler.thread.take() {
            let _ = handle.join();
        }
    }
}