summary refs log tree commit diff
path: root/src/libextra/sync.rs
AgeCommit message (Collapse)AuthorLines
2014-01-07'borrowed pointer' -> 'reference'Brian Anderson-1/+1
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-8/+17
2013-12-25Test fixes and rebase conflictsAlex Crichton-17/+15
* vec::raw::to_ptr is gone * Pausible => Pausable * Removing @ * Calling the main task "<main>" * Removing unused imports * Removing unused mut * Bringing some libextra tests up to date * Allowing compiletest to work at stage0 * Fixing the bootstrap-from-c rmake tests * assert => rtassert in a few cases * printing to stderr instead of stdout in fail!()
2013-12-24std: Remove must deferred sending functionsAlex Crichton-1/+1
These functions are all unnecessary now, and they only have meaning in the M:N context. Removing these functions uncovered a bug in the librustuv timer bindings, but it was fairly easy to cover (and the test is already committed). These cannot be completely removed just yet due to their usage in the WaitQueue of extra::sync, and until the mutex in libextra is rewritten it will not be possible to remove the deferred sends for channels.
2013-12-24std: Introduce std::syncAlex Crichton-2/+3
For now, this moves the following modules to std::sync * UnsafeArc (also removed unwrap method) * mpsc_queue * spsc_queue * atomics * mpmc_bounded_queue * deque We may want to remove some of the queues, but for now this moves things out of std::rt into std::sync
2013-12-23extra: Fix all code examplesAlex Crichton-2/+5
2013-12-17Don't allow impls to force public typesAlex Crichton-1/+1
This code in resolve accidentally forced all types with an impl to become public. This fixes it by default inheriting the privacy of what was previously there and then becoming `true` if nothing else exits. Closes #10545
2013-12-16Test fallout from std::comm rewriteAlex Crichton-1/+1
2013-12-16Fallout of rewriting std::commAlex Crichton-51/+50
2013-12-11Make 'self lifetime illegal.Erik Price-10/+10
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-12-10libextra: Remove various cells involved in `Arc`s.Patrick Walton-5/+4
I could have done this by making `Arc` use RAII, but this is too involved for now.
2013-11-26librustc: Fix merge fallout.Patrick Walton-6/+2
2013-11-26test: Remove all remaining non-procedure uses of `do`.Patrick Walton-116/+116
2013-11-26librustuv: Remove all non-`proc` uses of `do` from `libextra` andPatrick Walton-42/+48
`librustuv`.
2013-11-24Remove linked failure from the runtimeAlex Crichton-135/+109
The reasons for doing this are: * The model on which linked failure is based is inherently complex * The implementation is also very complex, and there are few remaining who fully understand the implementation * There are existing race conditions in the core context switching function of the scheduler, and possibly others. * It's unclear whether this model of linked failure maps well to a 1:1 threading model Linked failure is often a desired aspect of tasks, but we would like to take a much more conservative approach in re-implementing linked failure if at all. Closes #8674 Closes #8318 Closes #8863
2013-11-19Remove NonCopyable::newSteven Fackler-5/+5
The issue that required it has been fixed.
2013-11-19libextra: Convert uses of `&fn(A)->B` to `|A|->B`.Patrick Walton-16/+20
2013-10-28Allow fail messages to be caught, and introduce the Any traitMarvin Löbel-4/+4
Some code cleanup, sorting of import blocks Removed std::unstable::UnsafeArc's use of Either Added run-fail tests for the new FailWithCause impls Changed future_result and try to return Result<(), ~Any>. - Internally, there is an enum of possible fail messages passend around. - In case of linked failure or a string message, the ~Any gets lazyly allocated in future_results recv method. - For that, future result now returns a wrapper around a Port. - Moved and renamed task::TaskResult into rt::task::UnwindResult and made it an internal enum. - Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
2013-10-23Removed unnecessary comments and white spaces as suggestedreedlepee-3/+0
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-5/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-1/+9
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-11/+11
Who doesn't like a massive renaming?
2013-10-15Require module documentation with missing_docAlex Crichton-0/+2
Closes #9824
2013-09-30extra: Remove usage of fmt!Alex Crichton-11/+11
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-2/+2
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-08-31Cleanup concurrency testsSteven Stewart-Gallus-105/+104
In this commit I: - removed unneeded heap allocations - added extra whitespace to crowded expressions - and removed unneeded syntax
2013-08-27auto merge of #8790 : huonw/rust/unsafearc, r=thestingerbors-3/+3
`UnsafeAtomicRcBox` &rarr; `UnsafeArc` (#7674), and `AtomicRcBoxData` &rarr; `ArcData` to reflect this. Also, the inner pointer of `UnsafeArc` is now `*mut ArcData`, which avoids some transmutes to `~`: i.e. less chance of mistakes.
2013-08-27Rename UnsafeAtomicRcBox to UnsafeArc. Fixes #7674.Huon Wilson-3/+3
2013-08-27Make rekillable consistent with unkillableFlaper Fesp-29/+19
As for now, rekillable is an unsafe function, instead, it should behave just like unkillable by encapsulating unsafe code within an unsafe block. This patch does that and removes unsafe blocks that were encapsulating rekillable calls throughout rust's libs. Fixes #8232
2013-08-22Enabled unit tests in std and extra.Vadim Chugunov-12/+12
2013-08-16Reserve 'yield' keywordKevin Ballard-10/+10
Rename task::yield() to task::deschedule(). Fixes #8494.
2013-08-10auto merge of #8327 : sstewartgallus/rust/factor_out_waitqueue, r=bblumbors-13/+13
I'm a bit disappointed that I couldn't figure out how to factor out more of the code implementing `extra::sync` but I feel this is an okay start. Also I added some documentation explaining that `WaitQueue` isn't thread safe, and needs an exclusive lock. @bblum
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-2/+3
2013-08-08Isolate common wait_end logicSteven Stewart-Gallus-13/+13
2013-08-07Disable linked failure testsBrian Anderson-0/+2
The implementation currently contains a race that leads to segfaults.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-6/+6
this has been replaced by `for`
2013-08-02(cleanup) Use more do...finally in extra::sync.Ben Blum-207/+102
2013-08-02Add SendDeferred trait and use it to fix #8214.Ben Blum-4/+5
2013-08-01std: Change `Times` trait to use `do` instead of `for`blake2-ppc-12/+12
Change the former repetition:: for 5.times { } to:: do 5.times { } .times() cannot be broken with `break` or `return` anymore; for those cases, use a numerical range loop instead.
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-6/+6
2013-07-31auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwaltonbors-1/+1
This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
2013-07-30std: Remove ManualThreads spawn modeBrian Anderson-1/+1
2013-07-30Unkillable is not unsafe. Close #7832.Ben Blum-28/+20
2013-07-27Change concurrency primitives to standard naming conventionsSteven Stewart-Gallus-166/+168
To be more specific: `UPPERCASETYPE` was changed to `UppercaseType` `type_new` was changed to `Type::new` `type_function(value)` was changed to `value.method()`
2013-07-16Rename Option swap_unwrap to take_unwrap. Fixes Issue#7764Austin King-4/+4
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-13/+11
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-5/+7
for making them noncopyable.
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-1/+1
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.
2013-06-28librustc: Rewrite reachability and forbid duplicate methods in type ↵Patrick Walton-3/+5
implementations. This should allow fewer symbols to be exported.
2013-06-28librustc: Change "Owned" to "Send" everywherePatrick Walton-3/+3