Implement Send + Sync for WhisperVadContext

All data stored internally on this struct appears to be similar to what's stored on WhisperContext so this should also be threadsafe.
This commit is contained in:
Niko 2025-09-10 19:15:58 -07:00
parent d966ab1602
commit 8bf0602e24
No known key found for this signature in database

View file

@ -141,6 +141,8 @@ impl WhisperVadContextParams {
pub struct WhisperVadContext { pub struct WhisperVadContext {
ptr: *mut whisper_vad_context, ptr: *mut whisper_vad_context,
} }
unsafe impl Send for WhisperVadContext {}
unsafe impl Sync for WhisperVadContext {}
impl WhisperVadContext { impl WhisperVadContext {
pub fn new(model_path: &str, params: WhisperVadContextParams) -> Result<Self, WhisperError> { pub fn new(model_path: &str, params: WhisperVadContextParams) -> Result<Self, WhisperError> {