]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys_common/condvar.rs
Rollup merge of #98334 - JohnTitor:issue-73727, r=compiler-errors
[rust.git] / library / std / src / sys_common / condvar.rs
index 67d4b1262091acba0d6cc169eea77a12c0ac2e4c..f3ac1061b8935045ab1b01ca920dd324c4e06999 100644 (file)
@@ -14,10 +14,9 @@ pub struct Condvar {
 
 impl Condvar {
     /// Creates a new condition variable for use.
-    pub fn new() -> Self {
-        let mut c = imp::MovableCondvar::from(imp::Condvar::new());
-        unsafe { c.init() };
-        Self { inner: c, check: CondvarCheck::new() }
+    #[inline]
+    pub const fn new() -> Self {
+        Self { inner: imp::MovableCondvar::new(), check: CondvarCheck::new() }
     }
 
     /// Signals one waiter on this condition variable to wake up.
@@ -55,9 +54,3 @@ pub unsafe fn wait_timeout(&self, mutex: &MovableMutex, dur: Duration) -> bool {
         self.inner.wait_timeout(mutex.raw(), dur)
     }
 }
-
-impl Drop for Condvar {
-    fn drop(&mut self) {
-        unsafe { self.inner.destroy() };
-    }
-}