mozilla/rust — pull request #2136 by brson (2012-04-05 21:17:08+00:00)
Title: core: Add priv::chan_from_global_ptr

This allows singleton, globally accessible tasks to be created, for the purpose of creating a global, default I/O loop.

It's a function that takes a pointer to a pointer-sized memory location, a task builder, and a task function, and returns a singleton channel to another task. It uses compare and swap.

For uv to use it we will have a single `uintptr_t` field on `rust_kernel` called `global_io_chan` to hold the handle.

It's in the `priv` mod because I couldn't think of where else to put it. It is not intended to be a public API.