configure_thread_pool_once

Function configure_thread_pool_once 

Source
pub fn configure_thread_pool_once(max_threads: usize) -> OcrResult<()>
Expand description

Configures the global rayon thread pool if not already configured.

This function uses std::sync::Once to ensure the global thread pool is only configured once, preventing race conditions and silent failures that can occur when build_global() is called multiple times.

§Arguments

  • max_threads - Maximum number of threads to use for the thread pool

§Returns

A Result indicating success or an OCRError if configuration fails