mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
Remove old comm-based weak task interface
This commit is contained in:
@@ -368,30 +368,6 @@ rust_kernel::unregister_task() {
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rust_kernel::weaken_task(rust_port_id chan) {
|
||||
{
|
||||
scoped_lock with(weak_task_lock);
|
||||
KLOG_("Weakening task with channel %" PRIdPTR, chan);
|
||||
weak_task_chans.push_back(chan);
|
||||
}
|
||||
inc_weak_task_count();
|
||||
}
|
||||
|
||||
void
|
||||
rust_kernel::unweaken_task(rust_port_id chan) {
|
||||
dec_weak_task_count();
|
||||
{
|
||||
scoped_lock with(weak_task_lock);
|
||||
KLOG_("Unweakening task with channel %" PRIdPTR, chan);
|
||||
std::vector<rust_port_id>::iterator iter =
|
||||
std::find(weak_task_chans.begin(), weak_task_chans.end(), chan);
|
||||
if (iter != weak_task_chans.end()) {
|
||||
weak_task_chans.erase(iter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rust_kernel::inc_weak_task_count() {
|
||||
uintptr_t new_non_weak_tasks = sync::decrement(non_weak_tasks);
|
||||
@@ -407,23 +383,6 @@ rust_kernel::dec_weak_task_count() {
|
||||
KLOG_("New non-weak tasks %" PRIdPTR, new_non_weak_tasks);
|
||||
}
|
||||
|
||||
void
|
||||
rust_kernel::end_weak_tasks() {
|
||||
std::vector<rust_port_id> chancopies;
|
||||
{
|
||||
scoped_lock with(weak_task_lock);
|
||||
chancopies = weak_task_chans;
|
||||
weak_task_chans.clear();
|
||||
}
|
||||
while (!chancopies.empty()) {
|
||||
rust_port_id chan = chancopies.back();
|
||||
chancopies.pop_back();
|
||||
KLOG_("Notifying weak task " PRIdPTR, chan);
|
||||
uintptr_t token = 0;
|
||||
send_to_port(chan, &token);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
rust_kernel::begin_shutdown() {
|
||||
{
|
||||
@@ -439,7 +398,6 @@ rust_kernel::begin_shutdown() {
|
||||
|
||||
run_exit_functions();
|
||||
allow_scheduler_exit();
|
||||
end_weak_tasks();
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user