add Send and Sync impls
This commit is contained in:
parent
60d22b0330
commit
d2e48983b9
2 changed files with 12 additions and 0 deletions
|
|
@ -453,3 +453,9 @@ impl Drop for WhisperContext {
|
|||
unsafe { whisper_rs_sys::whisper_free(self.ctx) };
|
||||
}
|
||||
}
|
||||
|
||||
// following implementations are safe
|
||||
// see https://github.com/ggerganov/whisper.cpp/issues/32#issuecomment-1272790388
|
||||
// concurrent usage is prevented by &mut self on methods that modify the struct
|
||||
unsafe impl Send for WhisperContext {}
|
||||
unsafe impl Sync for WhisperContext {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue