mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-23 17:05:36 +01:00
Merge 'core/vtab: Mark VTabModuleImpl as Send and Sync' from Pekka Enberg
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3171
This commit is contained in:
@@ -429,7 +429,7 @@ impl Drop for ExtVirtualTableCursor {
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InternalVirtualTable: std::fmt::Debug {
|
||||
pub trait InternalVirtualTable: std::fmt::Debug + Send + Sync {
|
||||
fn name(&self) -> String;
|
||||
fn open(
|
||||
&self,
|
||||
@@ -444,7 +444,7 @@ pub trait InternalVirtualTable: std::fmt::Debug {
|
||||
fn sql(&self) -> String;
|
||||
}
|
||||
|
||||
pub trait InternalVirtualTableCursor {
|
||||
pub trait InternalVirtualTableCursor: Send + Sync {
|
||||
/// next returns `Ok(true)` if there are more rows, and `Ok(false)` otherwise.
|
||||
fn next(&mut self) -> Result<bool, LimboError>;
|
||||
fn rowid(&self) -> i64;
|
||||
|
||||
@@ -30,6 +30,11 @@ pub struct VTabModuleImpl {
|
||||
pub best_idx: BestIdxFn,
|
||||
}
|
||||
|
||||
// SAFETY: VTabModuleImpl contains function pointers and a name pointer that are
|
||||
// immutable after creation and, therefore, safe to share between threads.
|
||||
unsafe impl Send for VTabModuleImpl {}
|
||||
unsafe impl Sync for VTabModuleImpl {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct VTabCreateResult {
|
||||
pub code: ResultCode,
|
||||
|
||||
Reference in New Issue
Block a user