Skip to main content

Module thread_safety

Module thread_safety 

Source
Expand description

Provide limited protection for multithreaded access to the R API.

Re-exportsยง

use extendr_ffi::R_MakeUnwindCont; ๐Ÿ”’
use extendr_ffi::R_UnwindProtect; ๐Ÿ”’
use extendr_ffi::Rboolean; ๐Ÿ”’
use extendr_ffi::Rf_error; ๐Ÿ”’
use extendr_ffi::Rf_protect; ๐Ÿ”’
use extendr_ffi::Rf_unprotect; ๐Ÿ”’
use std::cell::Cell; ๐Ÿ”’
use std::sync::Mutex; ๐Ÿ”’
use crate::*; ๐Ÿ”’

Constantsยง

THREAD_HAS_LOCK ๐Ÿ”’

Staticsยง

R_API_LOCK ๐Ÿ”’
A global lock, that should represent the global lock on the R-API. It is not tied to an actual instance of R.
R_ERROR_BUF ๐Ÿ”’

Functionsยง

catch_r_error
Wrap an R function such as Rf_findFunction and convert errors and panics into results.
register_extendr_panic_hook
This function registers a configurable print panic hook, for use in extendr-based R-packages. If the environment variable EXTENDR_BACKTRACE is set to either true or 1, then it displays the entire Rust panic traceback (default hook), otherwise it omits the panic backtrace.
single_threaded
Run f while ensuring that f runs in a single-threaded manner.
stop
An alias to throw_r_error
throw_r_error
Signals an error via extendr_ffi::Rf_error