Jorge Aparicio
e4f9db7b8f
core: fix unused_macro warning
...
when compiling the crate for a target with max-atomic-width = 0
fixes #42097
2017-05-18 23:33:08 -05:00
Corey Farwell
1a5284c32b
Rollup merge of #41217 - topecongiro:docs/atomic-fence, r=steveklabnik
...
Update docs of 'fence'
This PR updates the docs for `std::sync::atomic::fence` with an example and a diagram.
Part of #29377 .
r? @steveklabnik
2017-05-02 21:21:17 -04:00
Steven Stewart-Gallus
f4fe3cd0e9
Added spin loop pause function
2017-05-01 17:11:44 -07:00
topecongiro
91a9866bb3
Add an example for 'fence'
2017-05-01 17:25:07 +09:00
Jon Gjengset
368d56010a
Rename compiler_barrier to compiler_fence
...
This addresses concerns raised following the merge of #41092 .
Specifically:
> The naming of these seems surprising: the multithreaded functions (and
> both the single and multithreaded intrinsics themselves) are fences,
> but this is a barrier. It's not incorrect, but the latter is both
> inconsistent with the existing functions and slightly confusing with
> another type in std (e.g., `Barrier`).
`compiler_fence` carries the same semantic implication that this is a
compiler-only operation, while being more in line with the fence/barrier
concepts already in use in `std`.
2017-04-13 10:27:52 -04:00
bors
b2d9b6323e
Auto merge of #41092 - jonhoo:std-fence-intrinsics, r=alexcrichton
...
Add safe wrapper for atomic_compilerfence intrinsics
This PR adds a proposed safe wrapper for the `atomic_singlethreadfence_*` intrinsics introduced by [RFC #888 ](https://github.com/rust-lang/rfcs/pull/888 ). See #41091 for further discussion.
2017-04-08 22:37:35 +00:00
Stjepan Glavina
f7ffe5bd24
Replace compare_exchange with swap
2017-04-07 18:04:15 +02:00
Stjepan Glavina
5c5a5182c9
Optimize AtomicBool::fetch_nand
2017-04-07 17:36:50 +02:00
Oliver Middleton
b4be475836
Fix Markdown issues in the docs
...
* Since the switch to pulldown-cmark reference links need a blank line
before the URLs.
* Reference link references are not case sensitive.
* Doc comments need to be indented uniformly otherwise rustdoc gets
confused.
2017-04-06 12:57:40 +01:00
Jon Gjengset
f6d262a326
Add unstable book entry
2017-04-06 03:37:08 -04:00
Ariel Ben-Yehuda
fc5ff66b04
Rollup merge of #40927 - stjepang:docs-atomic-overflow-note, r=alexcrichton
...
Add a note about overflow for fetch_add/fetch_sub
Fixes #40916
Fixes #34618
r? @steveklabnik
2017-04-05 23:01:07 +00:00
Jon Gjengset
2598e4574e
Add safe wrapper for atomic_singlethreadfence_*
2017-04-05 15:46:55 -04:00
Stjepan Glavina
2946c41c05
More consistent wording
2017-03-30 16:23:46 +02:00
Stjepan Glavina
3fa28cc11e
Add a note about overflow for fetch_add/fetch_sub
2017-03-30 16:10:55 +02:00
projektir
4ea03c876b
Fixing formatting issues #29377
2017-03-29 00:52:16 -04:00
projektir
756f2248f7
Adding links for Atomics docs #29377
2017-03-27 23:55:03 -04:00
Alex Crichton
bfa264271c
Revert "Add 128-bit atomics"
...
This reverts commit 9903975003 .
2017-02-06 10:39:14 -08:00
Corey Farwell
c4c6c49e52
Rollup merge of #38959 - Amanieu:atomic128, r=alexcrichton
...
Add 128-bit atomics
This is currently only supported on AArch64 since that is the only target which unconditionally supports 128-bit atomic operations.
cc #35118
2017-02-05 09:14:37 -05:00
Oliver Middleton
09b3903aec
Fix a few links in the docs
2017-01-27 18:08:51 +00:00
Geoff Yoerger
c0a5b99f01
Revert previous commit
2017-01-20 09:25:03 -06:00
Geoff Yoerger
dfa9736e9f
Clarify the default option to use
2017-01-19 21:43:34 -06:00
Geoff Yoerger
02ead27c93
Into item level docs (enum Ordering)
2017-01-19 20:43:43 -06:00
Geoff Yoerger
c4c9ff2f00
'.'
2017-01-19 20:39:54 -06:00
Geoff Yoerger
b4192aa4df
Module level doc
2017-01-19 20:38:26 -06:00
Amanieu d'Antras
9903975003
Add 128-bit atomics
2017-01-10 13:20:38 +01:00
Alex Crichton
c41256c36f
Rollup merge of #38674 - GuillaumeGomez:atomic_fn_docs, r=frewsxcv
...
Add missing urls for atomic fn docs
r? @frewsxcv
2016-12-29 17:26:38 -08:00
Alex Crichton
3c8a17f4b0
Rollup merge of #38649 - GuillaumeGomez:atomicint_docs, r=frewsxcv
...
Add missing urls for atomic_int macros types
r? @frewsxcv
2016-12-29 17:26:30 -08:00
Alex Crichton
8b8ab85551
Rollup merge of #38635 - GuillaumeGomez:atomicptr_docs, r=frewsxcv
...
Add missing urls for AtomicPtr
r? @frewsxcv
2016-12-29 17:26:28 -08:00
Guillaume Gomez
c8e7b76d9b
Add missing urls for atomic fn docs
2016-12-29 11:31:16 +01:00
Guillaume Gomez
ef8d5e14b1
Add missing urls for AtomicPtr
2016-12-28 11:06:17 +01:00
Guillaume Gomez
94d58c203e
Add missing urls for atomic_int macros types
2016-12-28 11:00:53 +01:00
Guillaume Gomez
3907b93c57
Add missing urls in AtomicBool docs
2016-12-26 10:51:25 +01:00
Aaron Turon
e5363881a9
Stabilize std::sync::atomic::Atomic*::{get_mut, into_inner}
2016-12-15 10:56:55 -08:00
Amanieu d'Antras
5a2fb8806b
Prevent exhaustive matching of Ordering to allow for future extension
2016-10-23 11:56:51 +01:00
Srinivas Reddy Thatiparthy
5afd6d8206
Run rustfmt on libcore/sync folder
2016-10-16 22:11:01 +05:30
Guillaume Gomez
a638580c08
fix typos
2016-10-02 14:45:49 +02:00
athulappadan
41881e85bd
Documentation for default types modified
2016-09-11 22:58:01 +05:30
athulappadan
49e77dbf25
Documentation of what does for each type
2016-09-11 17:00:09 +05:30
Jeffrey Seyfried
e2ad3be178
Use #[prelude_import] in libcore.
2016-08-24 22:12:23 +00:00
bors
413ada3040
Auto merge of #35719 - Amanieu:atomic_access, r=alexcrichton
...
Implement RFC 1649
cc #35603 rust-lang/rfcs#1649
r? @alexcrichton
2016-08-18 18:44:54 -07:00
Amanieu d'Antras
330b7f7359
Implement RFC 1649
2016-08-16 22:22:53 +01:00
Andrii Dmytrenko
4b54dd7fd9
Use an existing constant name as an example.
2016-08-11 11:41:44 +01:00
Jorge Aparicio
5f80104431
core: fix cargo build for targets with "max-atomic-width": 0
...
This crate was failing to compile due to dead_code/unused_imports
warnings. This commits disables these two lints for these targets.
2016-08-02 14:34:40 -05:00
Wojciech Nawrocki
8841f26e94
atomic doc: fix statement
2016-06-02 19:36:10 +02:00
Alex Crichton
fa45670ce4
mk: Prepare for a new stage0 compiler
...
This commit prepares the source for a new stage0 compiler, the 1.10.0 beta
compiler. These artifacts are hot off the bots and should be ready to go.
2016-05-31 16:11:49 -07:00
bors
d5759a3417
Auto merge of #33699 - alexcrichton:stabilize-1.10, r=aturon
...
std: Stabilize APIs for the 1.10 release
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:
Stabilized:
* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`
Deprecated:
* `StaticCondvar` - this, and all other static synchronization primitives
below, are usable today through the lazy-static crate on
stable Rust today. Additionally, we'd like the non-static
versions to be directly usable in a static context one day,
so they're unlikely to be the final forms of the APIs in any
case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`
Closes #27717
Closes #27720
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-25 20:36:09 -07:00
Alex Crichton
cae91d7c8c
std: Stabilize APIs for the 1.10 release
...
This commit applies the FCP decisions made by the libs team for the 1.10 cycle,
including both new stabilizations and deprecations. Specifically, the list of
APIs is:
Stabilized:
* `os::windows::fs::OpenOptionsExt::access_mode`
* `os::windows::fs::OpenOptionsExt::share_mode`
* `os::windows::fs::OpenOptionsExt::custom_flags`
* `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags`
* `sync::Weak::new`
* `Default for sync::Weak`
* `panic::set_hook`
* `panic::take_hook`
* `panic::PanicInfo`
* `panic::PanicInfo::payload`
* `panic::PanicInfo::location`
* `panic::Location`
* `panic::Location::file`
* `panic::Location::line`
* `ffi::CStr::from_bytes_with_nul`
* `ffi::CStr::from_bytes_with_nul_unchecked`
* `ffi::FromBytesWithNulError`
* `fs::Metadata::modified`
* `fs::Metadata::accessed`
* `fs::Metadata::created`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* `SocketAddr::is_unnamed`
* `SocketAddr::as_pathname`
* `UnixStream::connect`
* `UnixStream::pair`
* `UnixStream::try_clone`
* `UnixStream::local_addr`
* `UnixStream::peer_addr`
* `UnixStream::set_read_timeout`
* `UnixStream::set_write_timeout`
* `UnixStream::read_timeout`
* `UnixStream::write_Timeout`
* `UnixStream::set_nonblocking`
* `UnixStream::take_error`
* `UnixStream::shutdown`
* Read/Write/RawFd impls for `UnixStream`
* `UnixListener::bind`
* `UnixListener::accept`
* `UnixListener::try_clone`
* `UnixListener::local_addr`
* `UnixListener::set_nonblocking`
* `UnixListener::take_error`
* `UnixListener::incoming`
* RawFd impls for `UnixListener`
* `UnixDatagram::bind`
* `UnixDatagram::unbound`
* `UnixDatagram::pair`
* `UnixDatagram::connect`
* `UnixDatagram::try_clone`
* `UnixDatagram::local_addr`
* `UnixDatagram::peer_addr`
* `UnixDatagram::recv_from`
* `UnixDatagram::recv`
* `UnixDatagram::send_to`
* `UnixDatagram::send`
* `UnixDatagram::set_read_timeout`
* `UnixDatagram::set_write_timeout`
* `UnixDatagram::read_timeout`
* `UnixDatagram::write_timeout`
* `UnixDatagram::set_nonblocking`
* `UnixDatagram::take_error`
* `UnixDatagram::shutdown`
* RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut`
* `<[_]>::binary_search_by_key`
Deprecated:
* `StaticCondvar` - this, and all other static synchronization primitives
below, are usable today through the lazy-static crate on
stable Rust today. Additionally, we'd like the non-static
versions to be directly usable in a static context one day,
so they're unlikely to be the final forms of the APIs in any
case.
* `CONDVAR_INIT`
* `StaticMutex`
* `MUTEX_INIT`
* `StaticRwLock`
* `RWLOCK_INIT`
* `iter::Peekable::is_empty`
Closes #27717
Closes #27720
cc #27784 (but encode methods still exist)
Closes #30014
Closes #30425
Closes #30449
Closes #31190
Closes #31399
Closes #31767
Closes #32111
Closes #32281
Closes #32312
Closes #32551
Closes #33018
2016-05-24 09:00:39 -07:00
Stefan Schindler
22615adf02
Catch thread in example
...
- Consume result of thread join()
- Add link to threading model
2016-05-19 23:05:08 +02:00
Manish Goregaokar
0ceb073038
Rollup merge of #33534 - dns2utf8:atomic_docs, r=GuillaumeGomez
...
Simplify text
This way it should be clear: Any number of other threads have this guaranty not just one other thread.
2016-05-15 20:13:41 +05:30
Amanieu d'Antras
915fa57a93
Make AtomicBool the same size as bool
2016-05-13 17:54:06 +01:00