summary refs log tree commit diff
path: root/library/std/src/sys/vxworks
AgeCommit message (Collapse)AuthorLines
2020-10-02Rollup merge of #77147 - fusion-engineering-forks:static-mutex, r=dtolnayYuki Okushi-7/+6
Split sys_common::Mutex in StaticMutex and MovableMutex. 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 `Box`ed 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. --- This will also make it easier to conditionally box mutexes later, by moving that decision into sys/sys_common. Some of the mutex implementations (at least those of Wasm and 'sys/unsupported') are safe to move, so wouldn't need a box. ~~(But that's blocked on #76932 for now.)~~ (See #77380.)
2020-09-27Split sys_common::Mutex in StaticMutex and MovableMutex.Mara Bos-7/+6
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.
2020-09-20try again to appease tidyWithout Boats-1/+0
2020-09-20fix typosWithout Boats-2/+2
2020-09-20Make RawFd implement the RawFd traitsWithout Boats-0/+20
2020-09-12Remove Windows details from Unix and VmWorks symlink() docstringsNicholas Bishop-9/+0
This note is not relevant to other operating systems.
2020-09-04Fix nlink example typoChris Gillespie-1/+1
2020-08-31std: move "mod tests/benches" to separate filesLzu Tao-27/+26
Also doing fmt inplace as requested.
2020-08-27Rollup merge of #75758 - bpangWR:master, r=Mark-SimulacrumDylan DPC-14/+5
Fixes for VxWorks r? @alexcrichton
2020-08-25For VxWorks:Pang, Baoshan-14/+5
fix building errors use wr-c++ as linker
2020-08-21Make raw standard stream constructors constTomasz Miąsko-3/+3
2020-08-21Remove result type from raw standard streams constructorsTomasz Miąsko-7/+7
Raw standard streams constructors are infallible. Remove unnecessary result type.
2020-08-15inline linkingPrabakaran Kumaresshan-6/+2
2020-08-15remove empty linesPrabakaran Kumaresshan-7/+0
2020-08-15resolve commentsPrabakaran Kumaresshan-16/+8
2020-08-15Switch to intra-doc links in std/src/sys/vxworks/ext/{fs,process}.rsPrabakaran Kumaresshan-19/+19
2020-07-27mv std libs to library/mark-0/+4805