Jonathas-Conceicao
cd7fb9dec2
channel doc: Fix misleading reference to None return on Receiver
...
Signed-off-by: Jonathas-Conceicao <jonathas.conceicao@ossystems.com.br>
2020-07-13 10:52:44 -03:00
dignifiedquire
18dffe8b43
refactor: switch to async-mutex for Mutex implementation
2020-06-26 10:30:58 +02:00
dignifiedquire
06eea4225b
feat: add PartialEq and Eq for channel Errors
...
Closes #792
2020-05-22 22:08:23 +02:00
Thayne McCombs
6f6fced103
feat: implement Barrier using Condvar
2020-05-07 22:26:46 +02:00
dignifiedquire
e4df1405c1
feat: add basic wasm support
2020-05-02 20:27:50 +02:00
dignifiedquire
fc9ee0dfdd
keep std::sync::Arc
2020-05-02 20:27:50 +02:00
dignifiedquire
1308fbdf55
switch to smol instead of an internal runtime
2020-05-02 20:27:50 +02:00
Thayne McCombs
db438abb8f
Implement async_std::sync::Condvar ( #369 )
...
* Implement async_std::sync::Condvar
Part of #217
* More rigourous detection of notification for condvar
* Use state of Waker instead of AtomicUsize to keep track of if task was
notified.
* Add test for notify_all
* Implement wait_timeout_until
And add warnings about spurious wakeups to wait and wait_timeout
* Use WakerSet for Condvar
This should also address concerns about spurious wakeups.
* Add test for wait_timeout with no lock held
* Add comments describing AwaitNotify struct
And remove an unnneded comment in a Debug implementation
2020-04-12 13:35:18 +02:00
k-nasa
11ee2a8985
fix
2020-03-22 19:25:40 +09:00
k-nasa
cfaec2aa95
re add spin_lock
2020-03-22 19:19:17 +09:00
k-nasa
24c5dbf949
Remove scheduler state
2020-03-20 23:13:20 +09:00
k-nasa
d7ee29a03f
fix test code
2020-03-19 19:16:12 +09:00
k-nasa
2b44c1be2e
refactor: swap to swap_and_compare
2020-03-19 18:41:00 +09:00
k-nasa
b1ec1ea930
Move Spinlock to sync module
2020-03-19 18:39:01 +09:00
Yoshua Wuyts
b7c7efc797
Update try_channel doctests
2020-03-16 00:05:39 +01:00
Yoshua Wuyts
7885c245c5
recverror
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2020-03-15 23:53:03 +01:00
Yoshua Wuyts
7b7b959a6e
mark channel errs as unstable
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2020-03-15 23:53:03 +01:00
Yoshua Wuyts
32dce319d3
expose try_recv and try_send on channels
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2020-03-15 23:53:03 +01:00
Yoshua Wuyts
bb11c676a1
doctests pass
2020-03-15 23:46:36 +01:00
Katharina Fey
aae835cc14
channel/recv: improving function docs and code example
...
At the moment it's not clear when and why recv returns Option<T>,
instead of just T. This changed comment makes it clear that None will
only be returned once no data will ever be sent again (i.e. after all
senders are gone).
2020-02-12 01:38:20 +01:00
Gary Guo
732ef10f98
Make code compile
2019-12-14 23:42:14 +08:00
Gary Guo
499a44ab3b
Use ?Sized in Mutex and RwLock
2019-12-14 23:34:55 +08:00
Yoshua Wuyts
31f129ebe7
backlink channel types
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-11-14 22:37:04 +01:00
Stjepan Glavina
0c2282ffdc
Optimization: a slot for the next task to run ( #529 )
...
* Optimization: a slot for the next task to run
* Only notify workers when a task is pushed into a queue
2019-11-13 20:32:37 +01:00
Stjepan Glavina
352f18bc2a
Use async_std::sync::Arc in examples ( #501 )
2019-11-11 11:10:36 +01:00
Stjepan Glavina
122e87364b
Remove cache padding in channels
2019-11-09 23:08:31 +01:00
Stjepan Glavina
548733e5d5
Cleanup stream traits ( #487 )
...
* Cleanup stream traits
* Fix docs
2019-11-09 11:22:09 +01:00
laizy
fb19ebde17
add Sync
constraint for RwLock to prevent memory unsafety ( #479 )
2019-11-08 08:56:55 +00:00
Yoshua Wuyts
335bd34470
Add "std" feature flag ( #476 )
...
* core feature
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
* introduce std + default features
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
* test std features on ci
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
* finish up all features
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
* Fix task_local macro
* Remove crossbeam-channel and futures-timer from std
* Move future::timeout() behind cfg_default
2019-11-07 23:56:58 +00:00
Stjepan Glavina
bc24503382
Fix deadlock when all receivers are dropped ( #474 )
...
* Fix deadlock when all receivers are dropped
* Add a comment to explain the behavior of try_send
* Disable clippy
2019-11-07 22:01:36 +00:00
Yoshua Wuyts
a064a5b13e
Merge pull request #459 from stjepang/expose-ext-traits
...
Expose extension traits in preludes
2019-11-07 02:48:50 +01:00
Stjepan Glavina
c34e0f8a35
Update futures to 0.3 ( #463 )
...
* Update futures to 0.3
* Fix a search-and-replace error
* Fix imports in tests
* Fix an import
2019-11-06 20:20:27 +00:00
Stjepan Glavina
93b01e36ed
Clippy fixes ( #462 )
2019-11-06 19:29:17 +00:00
Stjepan Glavina
a757cc02dc
Expose extension traits in preludes
2019-11-06 00:21:32 +01:00
Stjepan Glavina
6d421de992
Fix another clippy warning
2019-11-05 10:16:00 +00:00
Stjepan Glavina
5874392397
Fix a clippy warning
2019-11-04 18:48:49 +01:00
Stjepan Glavina
e9edadffc7
Fix a deadlock in channel
2019-11-04 18:15:12 +01:00
Stjepan Glavina
20cdf73bb0
Simplify RwLock using WakerSet ( #440 )
2019-11-04 02:40:55 +01:00
Stjepan Glavina
78614c6c1d
Clarify blocking in channel docs ( #448 )
2019-11-03 22:19:04 +01:00
Stjepan Glavina
87de4e1598
Add utility type WakerSet to the sync module ( #390 )
...
* Add utility type Registry to the sync module
* Remove unused import
* Split unregister into complete and cancel
* Refactoring and renaming
* Split remove() into complete() and cancel()
* Rename to WakerSet
* Ignore clippy warning
* Ignore another clippy warning
* Use stronger SeqCst ordering
2019-11-01 02:45:50 +01:00
Yoshua Wuyts
3a06a1211b
Add feedback from review
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-29 10:56:33 +01:00
Yoshua Wuyts
5f8e2cbd4a
add mod level docs for sync
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-10-28 00:34:27 +01:00
Stjepan Glavina
b2fe91385b
Add channel behind unstable feature flag ( #380 )
...
* Add channel behind unstable feature flag
* Don't check tests without unstable feature flag
* Fix typos
* Remove useless attribute
2019-10-23 17:02:03 +01:00
Taiki Endo
2abf5ca891
Deny warnings on CI ( #378 )
...
* Deny warnings on CI
* Fix some clippy warnings
2019-10-23 20:20:59 +09:00
Stjepan Glavina
ec23632f3e
Cleanup: replace cfg-if with our macros ( #361 )
...
* Cleanup: replace cfg-if with our macros
* Prefix macros with cfg_
* Remove #[macro_export] from internal macros
2019-10-17 19:17:49 +02:00
k-nasa
9d9543c46b
refactor: Remove needless main fn
2019-10-13 16:33:02 +09:00
Stjepan Glavina
de01a5c5b7
Stabilize io::Cursor
2019-10-09 17:19:34 +02:00
k-nasa
f08fcd0bbb
refactor
2019-10-01 18:08:24 +09:00
Yoshua Wuyts
06862d47c3
update Barrier example to match std::sync::Barrier 1:1
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-29 04:21:48 +02:00
Yoshua Wuyts
0b39306b74
fix barrier tests
...
Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
2019-09-26 17:24:24 +02:00