Expand description
Threading support (§57, §93, §85 Phase 1).
Thread-local state, concurrent parsing, concurrent transformation, shared immutable dictionaries, callback isolation.
§UPSTREAM-PARITY
libxml2’s threading support provides:
xmlInitThreads()/xmlCleanupThreads()— lifecyclexmlLockLibrary()/xmlUnlockLibrary()— global lock- Thread-local storage for error state and parser contexts
In modern libxml2 (2.12+), threading is initialized automatically
by xmlInitParser. The explicit thread functions exist for backward
compatibility.
In Rust, we use standard thread-safe primitives and thread_local!
for thread-local storage. The global lock is a no-op since Rust’s
type system prevents data races at compile time.
§Phase 1 status
Complete — all threading support is implemented.
Functions§
- cleanup_
threads - Clean up threading support.
- get_
thread_ count - Get the number of active threads (for compatibility).
- init_
threads - Initialize threading support.
- lock_
library - Lock the library (global mutex).
- threads_
initialized - Check whether threading has been initialized.
- unlock_
library - Unlock the library.