about summary refs log tree commit diff
path: root/src/libcore/task
AgeCommit message (Collapse)AuthorLines
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-10-24Update comment based on suggestion.Son-2/+3
2018-10-17Seems like we don't have to refer the file anymore.Son-4/+1
2018-10-17Add doc for impl From for WakerSon-0/+7
2018-10-01LocalWaker and Waker cleanupsTaylor Cramer-32/+33
2018-09-19Remove spawning from task::ContextTaylor Cramer-197/+9
2018-08-06Rename Executor trait to SpawnJosef Reinhard Brandl-32/+33
2018-08-04Remove redundant field names in structsljedrz-1/+1
2018-07-29Fix From<LocalWaker>Josef Reinhard Brandl-3/+5
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-7/+7
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-26Rollup merge of #52721 - cramertj:try-poll, r=aturonMark Rousskov-0/+54
std::ops::Try impl for std::task::Poll I originally left out the `Try` impl for `Poll` because I was curious if we needed it, and @MajorBreakfast and I had discussed the potential for it to introduce confusion about exactly what control-flow was happening at different points. However, after porting a pretty significant chunk of Fuchsia over to futures 0.3, I discovered that I was *constantly* having to do repetitive matching on `Poll<Result<...>>` or `Poll<Option<Result<...>>>` in order to propagate errors correctly. `try_poll` (propagate `Poll::Ready(Err(..))`s) helped in some places, but it was far more common to need some form of conversion between `Result`, `Poll<Result<...>>`, and `Poll<Option<Result<...>>>`. The `Try` trait conveniently provides all of these conversions in addition to a more concise syntax (`?`), so I'd like to experiment with using these instead. cc @seanmonstar r? @aturon Note: this change means that far more futures 0.1 code can work without significant changes since it papers over the fact that `Result` is no longer at the top-level when using `Stream` and `Future` (since it's now `Poll<Result<...>>` or `Poll<Option<Result<...>>>` instead of `Result<Poll<..>>` and `Result<Poll<Option<...>>>`).
2018-07-26Rollup merge of #52610 - MajorBreakfast:task-terminology, r=cramertjMark Rousskov-12/+18
Clarify what a task is Currently we call two distinct concepts "task": 1. The top-level future that is polled until completion 2. The lightweight "thread" that is responsible for polling the top-level future. What additional data beside the future is stored in this type varies between different `Executor` implementations. I'd prefer to return to the old formulation by @alexcrichton: ```rust /// A handle to a "task", which represents a single lightweight "thread" of /// execution driving a future to completion. pub struct Task { ``` Source: [`task_impl/mod.rs` in futures-rs 0.1](https://github.com/rust-lang-nursery/futures-rs/blob/1328fc9e8af5737183df477c7501e6ea24ff2053/src/task_impl/mod.rs#L49-L50) I think that this change will make it much easier to explain everything. r? @aturon @cramertj
2018-07-25std::ops::Try impl for std::task::PollTaylor Cramer-0/+54
2018-07-25Clarify what a task isJosef Reinhard Brandl-12/+18
2018-07-25Enforce #![deny(bare_trait_objects)] in src/libcoreljedrz-7/+7
2018-07-23Forget Waker when cloning LocalWakerThomas de Zeeuw-4/+5
Since NonNull is Copy the inner field of the cloned Waker was copied for use in the new LocalWaker, however this left Waker to be dropped. Which means that when cloning LocalWaker would also erroneously call drop_raw. This change forgets the Waker, rather then dropping it, leaving the inner field to be used by the returned LocalWaker. Closes #52629.
2018-07-12task: remove wrong comments about non-existent LocalWake traitSean McArthur-5/+3
2018-07-04Auto merge of #51935 - cramertj:unpin-references, r=withoutboatsbors-0/+3
Unpin references I also considered adding an impl for raw pointers as well, but that makes it easy to accidentally have unsound owning-collections that might otherwise be able to project pinned-ness (e.g. `Box`). cc @RalfJung r? @withoutboats
2018-07-02Add lifetime to `FutureObj`Josef Reinhard Brandl-154/+4
2018-07-02Make custom trait object for `Future` genericJosef Reinhard Brandl-53/+58
2018-06-29Make Waker and LocalWaker UnpinTaylor Cramer-0/+3
These types never project pinned-ness into their contents, so it is safe for them to be `Unpin`.
2018-06-26Move spawn errors into executor.rsJosef Reinhard Brandl-67/+50
2018-06-26Nested `LocalTaskObj` in `TaskObj`, remove `SpawnErrorObj` conversionsJosef Reinhard Brandl-75/+34
2018-06-26Add `LocalTaskObj`Josef Reinhard Brandl-6/+102
2018-06-26Split libcore/task.rs into submodulesJosef Reinhard Brandl-0/+676
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-2286/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-20core::rt: Implement Local for TaskBrian Anderson-5/+6
2013-05-20core::rt: Convert users of local_sched to Local traitBrian Anderson-1/+2
2013-05-20core:rt:: Rename LocalServices to TaskBrian Anderson-6/+6
2013-05-19Register snapshotsBrian Anderson-5/+0
2013-05-19auto merge of #6106 : thestinger/rust/iter, r=bstriebors-10/+9
I don't have a strong opinion on the function vs. method, but there's no point in having both. I'd like to make a `repeat` adaptor like Python/Haskell for turning a value into an infinite stream of the value, so this has to at least be renamed.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-10/+10
2013-05-18replace old_iter::repeat with the Times traitDaniel Micay-10/+9
2013-05-15Merge remote-tracking branch 'brson/io' into incomingBrian Anderson-19/+35
2013-05-15core::rt: Rename Task to CoroutineBrian Anderson-1/+1
2013-05-15core: Turn task::unkillable, etc. into no-ops in newsched. #6377Brian Anderson-17/+33
Not necessary just yet but they make ARC not work.
2013-05-15auto merge of #6493 : brson/rust/tls, r=thestingerbors-4/+2
2013-05-14core: Fix leak in TLS. #6231Brian Anderson-4/+2
2013-05-14Merge remote-tracking branch 'brson/io-upstream' into incomingBrian Anderson-1/+1
Conflicts: src/libcore/logging.rs src/libcore/rt/local_services.rs src/libcore/rt/uv/mod.rs src/libcore/rt/uv/net.rs src/libcore/rt/uv/uvio.rs src/libcore/unstable.rs
2013-05-14core::rt: Use unsafe pointers instead of transmuted regionsBrian Anderson-1/+1
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-8/+8
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-13Remove re-exports from libcore/core.rcAlex Crichton-2/+1
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude.
2013-05-13core: Move locks, atomic rc to unstable::syncBrian Anderson-6/+7
2013-05-11Warning policeTim Chevalier-1/+1
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-5/+8
Closes #6183. The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout. The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10core: Use the new `for` protocolAlex Crichton-5/+8
2013-05-10Move core::task::local_data to core::local_dataYoungsoo Son-228/+1
2013-05-09auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiynbors-1/+1
Hi there, Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes. Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`. Thanks! Sean
2013-05-08libcore: Fix tests.Patrick Walton-47/+52
2013-05-08librustc: Stop parsing modes and remove them entirely from the languagePatrick Walton-3/+3