diff options
| author | Eric Holk <eholk@mozilla.com> | 2011-06-24 15:56:12 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-06-28 16:12:33 -0700 |
| commit | c6d83248301b4aed366b9bef682d200381324c01 (patch) | |
| tree | 12d0f6b3abed022825454c21d6fdfb60e81492f3 /src/rt/rust_upcall.cpp | |
| parent | 1c852ac9c0d14b38bc956e3938256273980577b7 (diff) | |
| download | rust-c6d83248301b4aed366b9bef682d200381324c01.tar.gz rust-c6d83248301b4aed366b9bef682d200381324c01.zip | |
There is only one domain per kernel now.
Diffstat (limited to 'src/rt/rust_upcall.cpp')
| -rw-r--r-- | src/rt/rust_upcall.cpp | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/rt/rust_upcall.cpp b/src/rt/rust_upcall.cpp index 0947c44b2c9..a769051b7eb 100644 --- a/src/rt/rust_upcall.cpp +++ b/src/rt/rust_upcall.cpp @@ -557,86 +557,6 @@ upcall_start_task(rust_task *spawner, } /** - * Called whenever a new domain is created. - */ -extern "C" CDECL maybe_proxy<rust_task> * -upcall_new_thread(rust_task *task, const char *name) { - I(task->dom, false); - LOG_UPCALL_ENTRY(task); - rust_dom *parent_dom = task->dom; - rust_kernel *kernel = parent_dom->kernel; - rust_handle<rust_dom> *child_dom_handle = - kernel->create_domain(name); - rust_handle<rust_task> *child_task_handle = - kernel->get_task_handle(child_dom_handle->referent()->root_task); - LOG(task, mem, "child name: %s, child_dom_handle: " PTR - ", child_task_handle: " PTR, - name, child_dom_handle, child_task_handle); - rust_proxy<rust_task> *child_task_proxy = - new rust_proxy<rust_task> (child_task_handle); - return child_task_proxy; -} - -#if 0 /* FIXME: this code will be re-enabled once we have multithreading. */ - -#if defined(__WIN32__) -static DWORD WINAPI rust_thread_start(void *ptr) -#elif defined(__GNUC__) -static void *rust_thread_start(void *ptr) -#else -#error "Platform not supported" -#endif -{ - // We were handed the domain we are supposed to run. - rust_dom *dom = (rust_dom *) ptr; - - // Start a new rust main loop for this thread. - dom->start_main_loop(); - - // Destroy the domain. - dom->kernel->destroy_domain(dom); - - return 0; -} - -#endif - -/** - * Called after a new domain is created. Here we create a new thread and - * and start the domain main loop. - */ -extern "C" CDECL maybe_proxy<rust_task> * -upcall_start_thread(rust_task *task, - rust_proxy<rust_task> *child_task_proxy, - uintptr_t spawnee_fn, - size_t callsz) { - I(task->dom, false); - LOG_UPCALL_ENTRY(task); -#if 0 - rust_dom *parenet_dom = task->dom; - rust_handle<rust_task> *child_task_handle = child_task_proxy->handle(); - LOG(task, task, - "spawnee_fn " PTR - ", callsz %" PRIdPTR ")", - spawnee_fn, callsz); - rust_task *child_task = child_task_handle->referent(); - child_task->start(spawnee_fn, - task->rust_sp, callsz); -#if defined(__WIN32__) - HANDLE thread; - thread = CreateThread(NULL, 0, rust_thread_start, child_task->dom, 0, - NULL); - parenet_dom->win32_require("CreateThread", thread != NULL); -#else - pthread_t thread; - pthread_create(&thread, &parenet_dom->attr, rust_thread_start, - (void *) child_task->dom); -#endif -#endif // 0 - return child_task_proxy; -} - -/** * Resizes an interior vector that has been spilled to the heap. */ extern "C" CDECL void |
