summary refs log tree commit diff
path: root/src/librustuv/queue.rs
AgeCommit message (Collapse)AuthorLines
2014-03-28Convert most code to new inner attribute syntax.Brian Anderson-1/+1
Closes #2569
2014-02-24green,native,rustuv: Replace many pointer `transmute`'s with `as` or ↵Huon Wilson-1/+1
referencing. These can all be written in a more controlled manner than with the transmute hammer, leading to (hopefully) safer code.
2014-02-16std: add a NativeMutex type as a wrapper to destroy StaticNativeMutex.Huon Wilson-3/+3
This obsoletes LittleLock, and so it is removed.
2014-02-11Shuffle around ownership in concurrent queuesAlex Crichton-25/+26
Beforehand, using a concurrent queue always mandated that the "shared state" be stored internally to the queues in order to provide a safe interface. This isn't quite as flexible as one would want in some circumstances, so instead this commit moves the queues to not containing the shared state. The queues no longer have a "default useful safe" interface, but rather a "default safe" interface (minus the useful part). The queues have to be shared manually through an Arc or some other means. This allows them to be a little more flexible at the cost of a usability hindrance. I plan on using this new flexibility to upgrade a channel to a shared channel seamlessly.
2014-02-03std: Remove try_send_deferred plus all falloutAlex Crichton-1/+1
Now that extra::sync primitives are built on a proper mutex instead of a pthreads one, there's no longer any use for this function.
2014-02-03rustuv: Require all results are used and fix falloutAlex Crichton-1/+1
2013-12-24rustuv: Fix a use-after-free on destructionAlex Crichton-1/+7
The uv loop was being destroyed before the async handle was being destroyed, so closing the async handle was causing a use-after-free in the uv loop. This was fixed by moving destruction of the queue's async handle to an earlier location and then actually freeing it once the loop has been dropped.
2013-12-24Test fixes and rebase problemsAlex Crichton-0/+2
Note that this removes a number of run-pass tests which are exercising behavior of the old runtime. This functionality no longer exists and is thoroughly tested inside of libgreen and libnative. There isn't really the notion of "starting the runtime" any more. The major notion now is "bootstrapping the initial task".
2013-12-24rustuv: Reimplement without using std::rt::schedAlex Crichton-0/+184
This reimplements librustuv without using the interfaces provided by the scheduler in libstd. This solely uses the new Runtime trait in order to interface with the local task and perform the necessary scheduling operations. The largest snag in this refactoring is reimplementing homing. The new runtime trait exposes no concept of "homing" a task or forcibly sending a task to a remote scheduler (there is no concept of a scheduler). In order to reimplement homing, the transferrence of tasks is now done at the librustuv level instead of the scheduler level. This means that all I/O loops now have a concurrent queue which receives homing messages and requests. This allows the entire implementation of librustuv to be only dependent on the runtime trait, severing all dependence of librustuv on the scheduler and related green-thread functions. This is all in preparation of the introduction of libgreen and libnative. At the same time, I also took the liberty of removing all glob imports from librustuv.