about summary refs log tree commit diff
path: root/src/libcore/task
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-562/+0
2020-07-14Add core::ready! macroYoshua Wuyts-0/+64
2020-01-08Use matches macro in libcore and libstdIgor Aleksanov-4/+1
2019-12-18Propagate cfg bootstrapMark Rousskov-2/+2
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-0/+2
functions with a `const` modifier
2019-11-26Format libcore with rustfmtDavid Tolnay-30/+17
This commit applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in `outstanding_files`, the relevant commands were: $ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018 $ rg libcore outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of libcore.
2019-10-12Fix typoBO41-1/+1
2019-08-13Provide map_ok and map_err method for Poll<Option<Result<T, E>>>Gurwinder Singh-0/+28
2019-07-26Introduce built-in macros through libcoreVadim Petrochenkov-1/+1
2019-07-15Fix typo in RawWaker::new documentation0e4ef622-1/+1
poiner -> pointer
2019-05-23bump nightly to 1.37.0Pietro Albini-3/+2
2019-05-04Fix intra-doc link resolution failure on re-exporting libstdTaiki Endo-0/+23
2019-04-23Stabilize futures_apiTaylor Cramer-16/+46
2019-04-19libcore: deny more...Mazdak Farrokhzad-2/+2
2019-04-18libcore => 2018Taiki Endo-4/+4
2019-04-08Rename Waker::new_unchecked to Waker::from_rawTaylor Cramer-4/+4
2019-04-08Add Waker::wake_by_ref and make Waker::wake consume the WakerTaylor Cramer-7/+45
2019-04-05Future-proof the Futures APITaylor Cramer-5/+98
2019-03-11Improvements to comments in libstd, libcore, liballoc.Alexander Regueiro-1/+1
2019-02-12Merging masterMatthias Einwag-5/+6
2019-02-10libs: doc commentsAlexander Regueiro-12/+12
2019-02-06Change RawWaker constructor to const fnMatthias Einwag-4/+24
2019-02-05review suggestionsMatthias Einwag-0/+5
2019-02-05Apply more review suggestionsMatthias Einwag-0/+6
2019-02-04Add #[must_use] to core::task::PollTaiki Endo-0/+1
2019-02-03Apply review suggestions and fix testsMatthias Einwag-34/+31
2019-02-03Apply suggestions from code reviewMazdak Farrokhzad-4/+6
Co-Authored-By: Matthias247 <matthias.einwag@live.com>
2019-02-03Update the future/task APIMatthias Einwag-235/+83
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592. Changes: - Replacing UnsafeWake with RawWaker and RawWakerVtable - Removal of LocalWaker - Removal of Arc-based Wake trait
2018-12-25Remove licensesMark Rousskov-30/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
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