diff options
| author | bors <bors@rust-lang.org> | 2013-07-22 15:40:36 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-22 15:40:36 -0700 |
| commit | 73921f91a326e51118077ff3fd5c5c6196ff7c3a (patch) | |
| tree | 23b03c59e5ea158fc0db7095cf94393c0f4546a1 /src/rt/rust_kernel.cpp | |
| parent | 9ed82fbb43804ebc7e06daca5812079630ec8952 (diff) | |
| parent | 407bffb33e59db9c2ed0c0c5a6533f2ab88743e0 (diff) | |
| download | rust-73921f91a326e51118077ff3fd5c5c6196ff7c3a.tar.gz rust-73921f91a326e51118077ff3fd5c5c6196ff7c3a.zip | |
auto merge of #7883 : brson/rust/rm-std-net, r=graydon
This removes all the code from libextra that depends on libuv. After that it removes three runtime features that existed to support the global uv loop: weak tasks, runtime-global variables, and at_exit handlers. The networking code doesn't have many users besides servo, so shouldn't have much fallout. The timer code though is useful and will probably break out-of-tree code until the new scheduler lands, but I expect that to be soon. It also incidentally moves `os::change_dir_locked` to `std::unstable`. This is a function used by test cases to avoid cwd races and in my opinion shouldn't be public (#7870). Closes #7251 and #7870
Diffstat (limited to 'src/rt/rust_kernel.cpp')
| -rw-r--r-- | src/rt/rust_kernel.cpp | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp index 583f836c0d6..814cfbb310a 100644 --- a/src/rt/rust_kernel.cpp +++ b/src/rt/rust_kernel.cpp @@ -31,10 +31,7 @@ rust_kernel::rust_kernel(rust_env *env) : sched_reaper(this), osmain_driver(NULL), non_weak_tasks(0), - at_exit_runner(NULL), - at_exit_started(false), - env(env), - global_data(0) + env(env) { // Create the single threaded scheduler that will run on the platform's // main thread @@ -311,54 +308,9 @@ rust_kernel::begin_shutdown() { } } - run_exit_functions(); allow_scheduler_exit(); } -void -rust_kernel::register_exit_function(spawn_fn runner, fn_env_pair *f) { - scoped_lock with(at_exit_lock); - - assert(!at_exit_started && "registering at_exit function after exit"); - - if (at_exit_runner) { - // FIXME #2912 Would be very nice to assert this but we can't because - // of the way coretest works (the test case ends up using its own - // function) - //assert(runner == at_exit_runner - // && "there can be only one at_exit_runner"); - } - - at_exit_runner = runner; - at_exit_fns.push_back(f); -} - -void -rust_kernel::run_exit_functions() { - rust_task *task; - - { - scoped_lock with(at_exit_lock); - - assert(!at_exit_started && "running exit functions twice?"); - - at_exit_started = true; - - if (at_exit_runner == NULL) { - return; - } - - rust_scheduler *sched = get_scheduler_by_id(main_sched_id()); - assert(sched); - task = sched->create_task(NULL, "at_exit"); - - final_exit_fns.count = at_exit_fns.size(); - final_exit_fns.start = at_exit_fns.data(); - } - - task->start(at_exit_runner, NULL, &final_exit_fns); -} - // // Local Variables: // mode: C++ |
