MCPcopy Index your code
hub / github.com/RustPython/RustPython / check_thread

Method check_thread

crates/stdlib/src/_sqlite3.rs:1573–1585  ·  view source on GitHub ↗
(&self, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

1571 }
1572
1573 fn check_thread(&self, vm: &VirtualMachine) -> PyResult<()> {
1574 if self.check_same_thread.load(Ordering::Relaxed) {
1575 let creator_id = *self.thread_ident.lock();
1576 if std::thread::current().id() != creator_id {
1577 return Err(new_programming_error(
1578 vm,
1579 "SQLite objects created in a thread can only be used in that same thread."
1580 .to_owned(),
1581 ));
1582 }
1583 }
1584 Ok(())
1585 }
1586
1587 #[pygetset]
1588 fn in_transaction(&self, vm: &VirtualMachine) -> PyResult<bool> {

Callers 2

db_lockMethod · 0.45
closeMethod · 0.45

Calls 5

ErrClass · 0.50
loadMethod · 0.45
lockMethod · 0.45
idMethod · 0.45
to_ownedMethod · 0.45

Tested by

no test coverage detected