提交 75d92dba 编写于 作者: H Huon Wilson

std: add tests for the _noguard lock/signal/wait methods on Mutex.

上级 76a59fd6
......@@ -459,7 +459,7 @@ mod test {
use rt::thread::Thread;
#[test]
fn somke_lock() {
fn smoke_lock() {
static mut lock: Mutex = MUTEX_INIT;
unsafe {
let _guard = lock.lock();
......@@ -467,7 +467,7 @@ fn somke_lock() {
}
#[test]
fn somke_cond() {
fn smoke_cond() {
static mut lock: Mutex = MUTEX_INIT;
unsafe {
let mut guard = lock.lock();
......@@ -482,6 +482,32 @@ fn somke_cond() {
}
}
#[test]
fn smoke_lock_noguard() {
static mut lock: Mutex = MUTEX_INIT;
unsafe {
lock.lock_noguard();
lock.unlock_noguard();
}
}
#[test]
fn smoke_cond_noguard() {
static mut lock: Mutex = MUTEX_INIT;
unsafe {
lock.lock_noguard();
let t = Thread::start(proc() {
lock.lock_noguard();
lock.signal_noguard();
lock.unlock_noguard();
});
lock.wait_noguard();
lock.unlock_noguard();
t.join();
}
}
#[test]
fn destroy_immediately() {
unsafe {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册