Skip to content

Commit

Permalink
add global mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
Quba1 committed Jan 30, 2024
1 parent c68d4db commit c845a07
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "eccodes-sys"
description = "Low-level Rust bindings for latests ecCodes version."
repository = "https://github.com/ScaleWeather/eccodes-sys"
version = "0.5.1"
version = "0.5.2"
readme = "README.md"
authors = ["Jakub Lewandowski <[email protected]>"]
keywords = ["eccodes", "grib", "bufr", "meteorology", "weather"]
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
//!- `tests` - turns on generation of layout tests by `bindgen`, should not be used in production. Layout tests are off by default as they derefrence null pointers causing undefined behaviour
//!
use std::sync::Mutex;

/// Global mutex to synchronize functions that fail in concurrent context,
/// eg. `codes_handle_new_from_file`, `codes_index_add_file` etc.
pub static CODES_LOCK: Mutex<()> = Mutex::new(());

#[cfg(not(feature = "docs"))]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

Expand Down

0 comments on commit c845a07

Please sign in to comment.