Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/libnative/bookeeping.rs → src/libnative/bookkeeping.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! 1:1 Task bookeeping
//! 1:1 Task bookkeeping
//!
//! This module keeps track of the number of running 1:1 tasks so that entry
//! points with libnative know when it's possible to exit the program (once all
//! tasks have exited).
//!
//! The green counterpart for this is bookeeping on sched pools.
//! The green counterpart for this is bookkeeping on sched pools.

use std::sync::atomics;
use std::unstable::mutex::{Mutex, MUTEX_INIT};
Expand Down
6 changes: 3 additions & 3 deletions src/libnative/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -29,7 +29,7 @@
use std::os;
use std::rt;

mod bookeeping;
mod bookkeeping;
pub mod io;
pub mod task;

Expand Down Expand Up @@ -75,6 +75,6 @@ pub fn start(argc: int, argv: **u8, main: proc()) -> int {
/// number of arguments.
pub fn run(main: proc()) -> int {
main();
bookeeping::wait_for_other_tasks();
bookkeeping::wait_for_other_tasks();
os::get_exit_status()
}
8 changes: 4 additions & 4 deletions src/libnative/task.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand Down Expand Up @@ -27,7 +27,7 @@ use std::unstable::stack;

use io;
use task;
use bookeeping;
use bookkeeping;

/// Creates a new Task which is ready to execute as a 1:1 task.
pub fn new(stack_bounds: (uint, uint)) -> ~Task {
Expand Down Expand Up @@ -82,7 +82,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) {
// Note that this increment must happen *before* the spawn in order to
// guarantee that if this task exits it will always end up waiting for the
// spawned task to exit.
bookeeping::increment();
bookkeeping::increment();

// Spawning a new OS thread guarantees that __morestack will never get
// triggered, but we must manually set up the actual stack bounds once this
Expand All @@ -104,7 +104,7 @@ pub fn spawn_opts(opts: TaskOpts, f: proc()) {
let mut task = task;
task.put_runtime(ops as ~rt::Runtime);
task.run(|| { f.take_unwrap()() });
bookeeping::decrement();
bookkeeping::decrement();
})
}

Expand Down