1. 21 6月, 2022 1 次提交
  2. 06 6月, 2022 2 次提交
  3. 03 6月, 2022 2 次提交
  4. 21 3月, 2022 1 次提交
  5. 14 10月, 2020 2 次提交
    • M
      Remove lifetime from StaticMutex and assume 'static. · 44a2af32
      Mara Bos 提交于
      StaticMutex is only ever used with as a static (as the name already
      suggests). So it doesn't have to be generic over a lifetime, but can
      simply assume 'static.
      
      This 'static lifetime guarantees the object is never moved, so this is
      no longer a manually checked requirement for unsafe calls to lock().
      44a2af32
    • M
      Fix comment about non-reentrant StaticMutex::lock(). · 58756573
      Mara Bos 提交于
      The comment said it's UB to call lock() while it is locked. That'd be
      quite a useless Mutex. :) It was supposed to say 'locked by the same
      thread', not just 'locked'.
      58756573
  6. 09 10月, 2020 1 次提交
  7. 02 10月, 2020 2 次提交
  8. 27 9月, 2020 1 次提交
    • M
      Split sys_common::Mutex in StaticMutex and MovableMutex. · 6f6336b4
      Mara Bos 提交于
      The (unsafe) Mutex from sys_common had a rather complicated interface.
      You were supposed to call init() manually, unless you could guarantee it
      was neither moved nor used reentrantly.
      
      Calling `destroy()` was also optional, although it was unclear if 1)
      resources might be leaked or not, and 2) if destroy() should only be
      called when `init()` was called.
      
      This allowed for a number of interesting (confusing?) different ways to
      use this Mutex, all captured in a single type.
      
      In practice, this type was only ever used in two ways:
      
      1. As a static variable. In this case, neither init() nor destroy() are
         called. The variable is never moved, and it is never used
         reentrantly. It is only ever locked using the LockGuard, never with
         raw_lock.
      
      2. As a Boxed variable. In this case, both init() and destroy() are
         called, it will be moved and possibly used reentrantly.
      
      No other combinations are used anywhere in `std`.
      
      This change simplifies things by splitting this Mutex type into
      two types matching the two use cases: StaticMutex and MovableMutex.
      
      The interface of both new types is now both safer and simpler. The first
      one does not call nor expose init/destroy, and the second one calls
      those automatically in its new() and Drop functions. Also, the locking
      functions of MovableMutex are no longer unsafe.
      6f6336b4
  9. 28 7月, 2020 1 次提交
  10. 16 7月, 2020 1 次提交
  11. 23 12月, 2019 1 次提交
  12. 31 3月, 2019 1 次提交
  13. 28 2月, 2019 1 次提交
  14. 18 2月, 2019 1 次提交
    • S
      Use more impl header lifetime elision · 3bea2ca4
      Scott McMurray 提交于
      There are two big categories of changes in here
      
      - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
      - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
      
      I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
      3bea2ca4
  15. 26 12月, 2018 1 次提交
  16. 11 12月, 2018 1 次提交
  17. 07 12月, 2018 1 次提交
  18. 10 11月, 2018 2 次提交
  19. 09 8月, 2018 1 次提交
  20. 06 8月, 2018 3 次提交
  21. 17 6月, 2018 1 次提交
  22. 02 11月, 2016 1 次提交
  23. 25 8月, 2016 1 次提交
  24. 02 6月, 2016 1 次提交
  25. 27 5月, 2015 1 次提交
  26. 14 4月, 2015 1 次提交
  27. 02 2月, 2015 1 次提交
    • A
      std: Add a new `env` module · 70ed3a48
      Alex Crichton 提交于
      This is an implementation of [RFC 578][rfc] which adds a new `std::env` module
      to replace most of the functionality in the current `std::os` module. More
      details can be found in the RFC itself, but as a summary the following methods
      have all been deprecated:
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/578
      
      * `os::args_as_bytes`   => `env::args`
      * `os::args`            => `env::args`
      * `os::consts`          => `env::consts`
      * `os::dll_filename`    => no replacement, use `env::consts` directly
      * `os::page_size`       => `env::page_size`
      * `os::make_absolute`   => use `env::current_dir` + `join` instead
      * `os::getcwd`          => `env::current_dir`
      * `os::change_dir`      => `env::set_current_dir`
      * `os::homedir`         => `env::home_dir`
      * `os::tmpdir`          => `env::temp_dir`
      * `os::join_paths`      => `env::join_paths`
      * `os::split_paths`     => `env::split_paths`
      * `os::self_exe_name`   => `env::current_exe`
      * `os::self_exe_path`   => use `env::current_exe` + `pop`
      * `os::set_exit_status` => `env::set_exit_status`
      * `os::get_exit_status` => `env::get_exit_status`
      * `os::env`             => `env::vars`
      * `os::env_as_bytes`    => `env::vars`
      * `os::getenv`          => `env::var` or `env::var_string`
      * `os::getenv_as_bytes` => `env::var`
      * `os::setenv`          => `env::set_var`
      * `os::unsetenv`        => `env::remove_var`
      
      Many function signatures have also been tweaked for various purposes, but the
      main changes were:
      
      * `Vec`-returning APIs now all return iterators instead
      * All APIs are now centered around `OsString` instead of `Vec<u8>` or `String`.
        There is currently on convenience API, `env::var_string`, which can be used to
        get the value of an environment variable as a unicode `String`.
      
      All old APIs are `#[deprecated]` in-place and will remain for some time to allow
      for migrations. The semantics of the APIs have been tweaked slightly with regard
      to dealing with invalid unicode (panic instead of replacement).
      
      The new `std::env` module is all contained within the `env` feature, so crates
      must add the following to access the new APIs:
      
          #![feature(env)]
      
      [breaking-change]
      70ed3a48
  28. 07 1月, 2015 2 次提交
  29. 01 1月, 2015 1 次提交
  30. 31 12月, 2014 1 次提交
    • A
      std: Re-enable at_exit() · 9e224c2b
      Alex Crichton 提交于
      The new semantics of this function are that the callbacks are run when the *main
      thread* exits, not when all threads have exited. This implies that other threads
      may still be running when the `at_exit` callbacks are invoked and users need to
      be prepared for this situation.
      
      Users in the standard library have been audited in accordance to these new rules
      as well.
      
      Closes #20012
      9e224c2b
  31. 27 12月, 2014 2 次提交