Skip to content

Commit 320c4b2

Browse files
committed
Fix move of with_lock
1 parent df037f1 commit 320c4b2

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

netcdf/src/file.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl RawFile {
9797
let f = get_ffi_from_path(path);
9898
let mut ncid: nc_type = 0;
9999
unsafe {
100-
error::checked(super::with_lock(|| {
100+
error::checked(with_lock(|| {
101101
netcdf_sys::par::nc_open_par(
102102
f.as_ptr().cast(),
103103
options.bits(),
@@ -140,7 +140,7 @@ impl RawFile {
140140
let f = get_ffi_from_path(path);
141141
let mut ncid: nc_type = -1;
142142
unsafe {
143-
error::checked(super::with_lock(|| {
143+
error::checked(with_lock(|| {
144144
netcdf_sys::par::nc_create_par(
145145
f.as_ptr().cast(),
146146
options.bits(),
@@ -500,16 +500,12 @@ impl FileMut {
500500

501501
/// Open the file for new definitions
502502
pub fn redef(&mut self) -> error::Result<()> {
503-
error::checked(super::with_lock(|| unsafe {
504-
netcdf_sys::nc_redef(self.ncid())
505-
}))
503+
error::checked(with_lock(|| unsafe { netcdf_sys::nc_redef(self.ncid()) }))
506504
}
507505

508506
/// Close the file for new definitions
509507
pub fn enddef(&mut self) -> error::Result<()> {
510-
error::checked(super::with_lock(|| unsafe {
511-
netcdf_sys::nc_enddef(self.ncid())
512-
}))
508+
error::checked(with_lock(|| unsafe { netcdf_sys::nc_enddef(self.ncid()) }))
513509
}
514510
}
515511

netcdf/src/par.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
error::{checked, Result},
3-
with_lock,
3+
utils::with_lock,
44
};
55

66
use netcdf_sys::nc_type;

netcdf/src/variable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl<'g> Variable<'g> {
194194

195195
#[cfg(feature = "mpi")]
196196
fn access_mode(&self, mode: crate::par::AccessMode) -> error::Result<()> {
197-
error::checked(super::with_lock(|| unsafe {
197+
error::checked(utils::with_lock(|| unsafe {
198198
netcdf_sys::par::nc_var_par_access(
199199
self.ncid,
200200
self.varid,

0 commit comments

Comments
 (0)