Skip to content

Commit b597017

Browse files
clean unsafe op in unsafe fn
1 parent 9fd9c61 commit b597017

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

std/src/sys/sync/condvar/teeos.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -76,24 +76,24 @@ impl Condvar {
7676

7777
#[inline]
7878
pub unsafe fn wait(&self, mutex: &Mutex) {
79-
let mutex = mutex::raw(mutex);
79+
let mutex = unsafe { mutex::raw(mutex) };
8080
self.verify(mutex);
81-
let r = libc::pthread_cond_wait(raw(self), mutex);
81+
let r = unsafe { libc::pthread_cond_wait(raw(self), mutex) };
8282
debug_assert_eq!(r, 0);
8383
}
8484

8585
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
8686
use crate::sys::time::Timespec;
8787

88-
let mutex = mutex::raw(mutex);
88+
let mutex = unsafe { mutex::raw(mutex) };
8989
self.verify(mutex);
9090

9191
let timeout = Timespec::now(libc::CLOCK_MONOTONIC)
9292
.checked_add_duration(&dur)
9393
.and_then(|t| t.to_timespec())
9494
.unwrap_or(TIMESPEC_MAX);
9595

96-
let r = pthread_cond_timedwait(raw(self), mutex, &timeout);
96+
let r = unsafe { pthread_cond_timedwait(raw(self), mutex, &timeout) };
9797
assert!(r == libc::ETIMEDOUT || r == 0);
9898
r == 0
9999
}

0 commit comments

Comments
 (0)