core::rt: Rename block_running_task_and_then to deschedul_...
This commit is contained in:
parent
8e966216c7
commit
1cb78e736f
@ -195,7 +195,7 @@ fn terminate_current_task(&mut self) {
|
||||
/// The closure here is a *stack* closure that lives in the
|
||||
/// running task. It gets transmuted to the scheduler's lifetime
|
||||
/// and called while the task is blocked.
|
||||
fn block_running_task_and_then(&mut self, f: &fn(&mut Scheduler, ~Task)) {
|
||||
fn deschedule_running_task_and_then(&mut self, f: &fn(&mut Scheduler, ~Task)) {
|
||||
assert!(self.in_task_context());
|
||||
|
||||
rtdebug!("blocking task");
|
||||
@ -566,7 +566,7 @@ fn test_block_task() {
|
||||
let task = ~do Task::new(&mut sched.stack_pool) {
|
||||
do Scheduler::local |sched| {
|
||||
assert!(sched.in_task_context());
|
||||
do sched.block_running_task_and_then() |sched, task| {
|
||||
do sched.deschedule_running_task_and_then() |sched, task| {
|
||||
assert!(!sched.in_task_context());
|
||||
sched.task_queue.push_back(task);
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ fn connect(&mut self, addr: IpAddr) -> Option<~StreamObject> {
|
||||
assert!(scheduler.in_task_context());
|
||||
|
||||
// Block this task and take ownership, switch to scheduler context
|
||||
do scheduler.block_running_task_and_then |scheduler, task| {
|
||||
do scheduler.deschedule_running_task_and_then |scheduler, task| {
|
||||
|
||||
rtdebug!("connect: entered scheduler context");
|
||||
assert!(!scheduler.in_task_context());
|
||||
@ -181,7 +181,7 @@ fn listen(&mut self) -> Option<~StreamObject> {
|
||||
do Scheduler::local |scheduler| {
|
||||
assert!(scheduler.in_task_context());
|
||||
|
||||
do scheduler.block_running_task_and_then |_, task| {
|
||||
do scheduler.deschedule_running_task_and_then |_, task| {
|
||||
let task_cell = Cell(task);
|
||||
let mut server_tcp_watcher = server_tcp_watcher;
|
||||
do server_tcp_watcher.listen |server_stream_watcher, status| {
|
||||
@ -247,7 +247,7 @@ fn read(&mut self, buf: &mut [u8]) -> Result<uint, ()> {
|
||||
assert!(scheduler.in_task_context());
|
||||
let watcher = self.watcher();
|
||||
let buf_ptr: *&mut [u8] = &buf;
|
||||
do scheduler.block_running_task_and_then |scheduler, task| {
|
||||
do scheduler.deschedule_running_task_and_then |scheduler, task| {
|
||||
rtdebug!("read: entered scheduler context");
|
||||
assert!(!scheduler.in_task_context());
|
||||
let mut watcher = watcher;
|
||||
@ -293,7 +293,7 @@ fn write(&mut self, buf: &[u8]) -> Result<(), ()> {
|
||||
assert!(scheduler.in_task_context());
|
||||
let watcher = self.watcher();
|
||||
let buf_ptr: *&[u8] = &buf;
|
||||
do scheduler.block_running_task_and_then |_, task| {
|
||||
do scheduler.deschedule_running_task_and_then |_, task| {
|
||||
let mut watcher = watcher;
|
||||
let task_cell = Cell(task);
|
||||
let buf = unsafe { &*buf_ptr };
|
||||
@ -420,7 +420,7 @@ fn test_read_and_block() {
|
||||
// Yield to the other task in hopes that it
|
||||
// will trigger a read callback while we are
|
||||
// not ready for it
|
||||
do scheduler.block_running_task_and_then |scheduler, task| {
|
||||
do scheduler.deschedule_running_task_and_then |scheduler, task| {
|
||||
scheduler.task_queue.push_back(task);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user