script to enable/disable no_deadlocks::RwLock instead of std::sync::RwLock
This commit is contained in:
parent
0fcf852b72
commit
c63fd6d1f2
22 changed files with 60 additions and 28 deletions
|
@ -6,6 +6,7 @@ name = "NeStEd"
|
|||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
no_deadlocks = "*"
|
||||
cgmath = "0.17.0"
|
||||
termion = "1.5.5"
|
||||
signal-hook = "0.3.1"
|
||||
|
|
16
enable_nodeadlock.sh
Normal file
16
enable_nodeadlock.sh
Normal file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
enable_no_deadlock() {
|
||||
for f in $(find src -name *.rs)
|
||||
do
|
||||
sed -ibak -E "s/std::sync::RwLock(;|,|$)/no_deadlocks::RwLock\1/g" $f
|
||||
done
|
||||
}
|
||||
|
||||
disable_no_deadlock() {
|
||||
for f in $(find src -name *.rs)
|
||||
do
|
||||
sed -ibak -E "s/no_deadlocks::RwLock(;|,|$)/std::sync::RwLock\1/g" $f
|
||||
done
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
use {
|
||||
async_std::stream::StreamExt,
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
collections::HashMap,
|
||||
cmp::{min, max}
|
||||
},
|
||||
cgmath::{Point2, Vector2},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast, ChannelReceiver, ChannelSender},
|
||||
terminal::{TerminalView, TerminalAtom},
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use {
|
||||
crate::core::View,
|
||||
std::{
|
||||
sync::{Arc, Weak, RwLock}
|
||||
}
|
||||
sync::{Arc, Weak}
|
||||
},
|
||||
std::sync::RwLock
|
||||
};
|
||||
|
||||
/*\
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use {
|
||||
std::sync::{Arc, RwLock},
|
||||
std::sync::Arc,
|
||||
std::any::Any,
|
||||
std::sync::RwLock,
|
||||
crate::core::{
|
||||
View,
|
||||
Observer,
|
||||
|
|
|
@ -11,7 +11,8 @@ pub trait View : Send + Sync {
|
|||
|
||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||
|
||||
use std::sync::{Arc, RwLock};
|
||||
use std::sync::Arc;
|
||||
use std::sync::RwLock;
|
||||
|
||||
impl<V: View + ?Sized> View for RwLock<V> {
|
||||
type Msg = V::Msg;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock}
|
||||
},
|
||||
std::sync::Arc,
|
||||
cgmath::{Point2, Vector2},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
View,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
pub use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
boxed::Box
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
View,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
pub use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
boxed::Box
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
View,
|
||||
|
|
|
@ -4,9 +4,10 @@ pub mod map_key;
|
|||
|
||||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
ops::Deref,
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::core::View
|
||||
};
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::{Arc},
|
||||
collections::HashSet
|
||||
},
|
||||
std::sync::RwLock,
|
||||
cgmath::Point2,
|
||||
crate::{
|
||||
core::{ViewPort, Observer, ObserverExt, ObserverBroadcast, InnerViewPort, OuterViewPort},
|
||||
|
|
|
@ -14,9 +14,8 @@ pub mod leveled_term_view;
|
|||
|
||||
use {
|
||||
async_std::{task},
|
||||
std::{
|
||||
sync::{Arc, RwLock}
|
||||
},
|
||||
std::sync::{Arc},
|
||||
std::sync::RwLock,
|
||||
cgmath::{Vector2, Point2},
|
||||
termion::event::{Event, Key},
|
||||
crate::{
|
||||
|
|
|
@ -2,11 +2,12 @@ use {
|
|||
std::{
|
||||
cmp::{max},
|
||||
any::Any,
|
||||
sync::{Arc, RwLock, Weak}
|
||||
sync::{Arc, Weak},
|
||||
},
|
||||
async_std::{
|
||||
stream::StreamExt
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{View, Observer, ObserverExt, OuterViewPort, channel::{channel, ChannelData, ChannelSender, ChannelReceiver}},
|
||||
singleton::{SingletonView},
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use {
|
||||
async_std::stream::StreamExt,
|
||||
std::{
|
||||
sync::{Arc, Weak, RwLock},
|
||||
sync::{Arc, Weak},
|
||||
collections::{HashMap, HashSet}
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
View, Observer, ObserverExt, ObserverBroadcast,
|
||||
|
|
|
@ -22,9 +22,10 @@ pub trait SequenceView : View<Msg = usize> {
|
|||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||
|
||||
use std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
ops::{Deref}
|
||||
};
|
||||
use std::sync::RwLock;
|
||||
|
||||
impl<V: SequenceView + ?Sized> SequenceView for RwLock<V> {
|
||||
type Item = V::Item;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock}
|
||||
sync::Arc
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
View, Observer, ObserverExt, ObserverBroadcast,
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
ops::{Deref, DerefMut}
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{View, Observer, ObserverExt, ObserverBroadcast, ViewPort, InnerViewPort, OuterViewPort},
|
||||
sequence::SequenceView,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock}
|
||||
sync::{Arc}
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{
|
||||
Observer,
|
||||
|
|
|
@ -3,9 +3,10 @@ pub mod buffer;
|
|||
|
||||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
ops::Deref
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::core::{View}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{RwLock}
|
||||
},
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{ViewPort, OuterViewPort},
|
||||
singleton::{SingletonView, SingletonBuffer},
|
||||
|
@ -101,12 +99,13 @@ impl StringEditor {
|
|||
pub mod insert_view {
|
||||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
cmp::{min, max},
|
||||
any::Any,
|
||||
collections::HashSet
|
||||
},
|
||||
cgmath::Point2,
|
||||
std::sync::RwLock,
|
||||
crate::{
|
||||
core::{View, Observer, ObserverExt, ObserverBroadcast, OuterViewPort, InnerViewPort},
|
||||
terminal::{TerminalAtom, TerminalStyle, TerminalView},
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, Weak, RwLock},
|
||||
sync::{Arc, Weak},
|
||||
collections::HashMap
|
||||
},
|
||||
std::sync::RwLock,
|
||||
cgmath::Point2,
|
||||
crate::{
|
||||
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast},
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use {
|
||||
std::{
|
||||
sync::{Arc, RwLock},
|
||||
sync::Arc,
|
||||
io::{Write, stdout, stdin},
|
||||
collections::HashSet
|
||||
},
|
||||
std::sync::RwLock,
|
||||
async_std::{
|
||||
stream::StreamExt,
|
||||
task
|
||||
|
|
Loading…
Reference in a new issue