rt: Add a hack to fix a port detach bug

This commit is contained in:
Brian Anderson
2012-03-05 20:02:25 -08:00
parent 32f7818e7f
commit ee991cae81
4 changed files with 12 additions and 1 deletions

View File

@@ -488,12 +488,16 @@ rust_port_begin_detach(rust_port *port, uintptr_t *yield) {
port->begin_detach(yield);
}
extern "C" CDECL void
rust_port_end_detach(rust_port *port) {
port->end_detach();
}
extern "C" CDECL void
del_port(rust_port *port) {
rust_task *task = rust_task_thread::get_task();
LOG(task, comm, "del_port(0x%" PRIxPTR ")", (uintptr_t) port);
A(task->thread, port->get_ref_count() == 0, "Expected port ref_count == 0");
port->end_detach();
delete port;
}