INNER CODE UNIT · Rust

drop

hcavarsan/kftray · crates/kftray-commons/src/lib.rs:36

        fn drop(&mut self) {
            clear_pools();
        }
    }

    fn clear_pools() {
        crate::utils::db::clear_db_pool();
        crate::utils::db_mode::DatabaseManager::cleanup_memory_pools();
    }

    /// Serializes environment-variable mutation across tests: `std::env` is
    /// global to the process, so two tests mutating it on different threads
    /// must not interleave.
    static ENV_MUTEX: Mutex<()> = Mutex::new(());

    thread_local! {
        // Depth of `EnvVarGuard`s already holding `ENV_MUTEX` on this
        // thread. A test commonly builds up several guards at once, one per

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…