mirror of
https://github.com/georust/netcdf.git
synced 2025-12-08 19:25:14 +00:00
Fix move of with_lock
This commit is contained in:
parent
df037f1d10
commit
b5b82773da
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -174,7 +174,7 @@ jobs:
|
||||
run: cargo test --verbose --workspace --exclude netcdf-src --features netcdf/mpi,derive
|
||||
|
||||
- name: Run example
|
||||
run: cargo run --verbose --package netcdf-examples --features mpi,derive
|
||||
run: cargo run --verbose --package netcdf-examples --features mpi
|
||||
|
||||
- name: Run example in parallel
|
||||
run: mpirun -np 10 --oversubscribe -- target/debug/netcdf-examples
|
||||
|
||||
@ -97,7 +97,7 @@ impl RawFile {
|
||||
let f = get_ffi_from_path(path);
|
||||
let mut ncid: nc_type = 0;
|
||||
unsafe {
|
||||
error::checked(super::with_lock(|| {
|
||||
error::checked(with_lock(|| {
|
||||
netcdf_sys::par::nc_open_par(
|
||||
f.as_ptr().cast(),
|
||||
options.bits(),
|
||||
@ -140,7 +140,7 @@ impl RawFile {
|
||||
let f = get_ffi_from_path(path);
|
||||
let mut ncid: nc_type = -1;
|
||||
unsafe {
|
||||
error::checked(super::with_lock(|| {
|
||||
error::checked(with_lock(|| {
|
||||
netcdf_sys::par::nc_create_par(
|
||||
f.as_ptr().cast(),
|
||||
options.bits(),
|
||||
@ -500,16 +500,12 @@ impl FileMut {
|
||||
|
||||
/// Open the file for new definitions
|
||||
pub fn redef(&mut self) -> error::Result<()> {
|
||||
error::checked(super::with_lock(|| unsafe {
|
||||
netcdf_sys::nc_redef(self.ncid())
|
||||
}))
|
||||
error::checked(with_lock(|| unsafe { netcdf_sys::nc_redef(self.ncid()) }))
|
||||
}
|
||||
|
||||
/// Close the file for new definitions
|
||||
pub fn enddef(&mut self) -> error::Result<()> {
|
||||
error::checked(super::with_lock(|| unsafe {
|
||||
netcdf_sys::nc_enddef(self.ncid())
|
||||
}))
|
||||
error::checked(with_lock(|| unsafe { netcdf_sys::nc_enddef(self.ncid()) }))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
error::{checked, Result},
|
||||
with_lock,
|
||||
utils::with_lock,
|
||||
};
|
||||
|
||||
use netcdf_sys::nc_type;
|
||||
|
||||
@ -194,7 +194,7 @@ impl<'g> Variable<'g> {
|
||||
|
||||
#[cfg(feature = "mpi")]
|
||||
fn access_mode(&self, mode: crate::par::AccessMode) -> error::Result<()> {
|
||||
error::checked(super::with_lock(|| unsafe {
|
||||
error::checked(utils::with_lock(|| unsafe {
|
||||
netcdf_sys::par::nc_var_par_access(
|
||||
self.ncid,
|
||||
self.varid,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user