Skip to content

Commit a2efa2a

Browse files
committed
Deprecate _ms functions that predate the Duration API
1 parent effcd29 commit a2efa2a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/compiletest/runtest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
430430
.expect(&format!("failed to exec `{:?}`", config.adb_path));
431431
loop {
432432
//waiting 1 second for gdbserver start
433-
::std::thread::sleep_ms(1000);
433+
::std::thread::sleep(::std::time::Duration::new(1,0));
434434
if TcpStream::connect("127.0.0.1:5039").is_ok() {
435435
break
436436
}

src/libstd/sync/condvar.rs

+3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ impl Condvar {
167167
/// Like `wait`, the lock specified will be re-acquired when this function
168168
/// returns, regardless of whether the timeout elapsed or not.
169169
#[stable(feature = "rust1", since = "1.0.0")]
170+
#[deprecated(since = "1.6.0", reason = "replaced by `std::sync::Condvar::wait_timeout`")]
171+
#[allow(deprecated)]
170172
pub fn wait_timeout_ms<'a, T>(&self, guard: MutexGuard<'a, T>, ms: u32)
171173
-> LockResult<(MutexGuard<'a, T>, bool)> {
172174
unsafe {
@@ -289,6 +291,7 @@ impl StaticCondvar {
289291
#[unstable(feature = "static_condvar",
290292
reason = "may be merged with Condvar in the future",
291293
issue = "27717")]
294+
#[deprecated(since = "1.6.0", reason = "replaced by `std::sync::StaticCondvar::wait_timeout`")]
292295
pub fn wait_timeout_ms<'a, T>(&'static self, guard: MutexGuard<'a, T>, ms: u32)
293296
-> LockResult<(MutexGuard<'a, T>, bool)> {
294297
match self.wait_timeout(guard, Duration::from_millis(ms as u64)) {

src/libstd/thread/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ pub fn catch_panic<F, R>(f: F) -> Result<R>
390390
/// this function will not return early due to a signal being received or a
391391
/// spurious wakeup.
392392
#[stable(feature = "rust1", since = "1.0.0")]
393+
#[deprecated(since = "1.6.0", reason = "replaced by `std::thread::sleep`")]
393394
pub fn sleep_ms(ms: u32) {
394395
sleep(Duration::from_millis(ms as u64))
395396
}
@@ -456,6 +457,7 @@ pub fn park() {
456457
///
457458
/// See the module doc for more detail.
458459
#[stable(feature = "rust1", since = "1.0.0")]
460+
#[deprecated(since = "1.6.0", reason = "replaced by `std::thread::park_timeout`")]
459461
pub fn park_timeout_ms(ms: u32) {
460462
park_timeout(Duration::from_millis(ms as u64))
461463
}

0 commit comments

Comments
 (0)