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"
|
version = "0.1.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
no_deadlocks = "*"
|
||||||
cgmath = "0.17.0"
|
cgmath = "0.17.0"
|
||||||
termion = "1.5.5"
|
termion = "1.5.5"
|
||||||
signal-hook = "0.3.1"
|
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 {
|
use {
|
||||||
async_std::stream::StreamExt,
|
async_std::stream::StreamExt,
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
cmp::{min, max}
|
cmp::{min, max}
|
||||||
},
|
},
|
||||||
cgmath::{Point2, Vector2},
|
cgmath::{Point2, Vector2},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast, ChannelReceiver, ChannelSender},
|
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast, ChannelReceiver, ChannelSender},
|
||||||
terminal::{TerminalView, TerminalAtom},
|
terminal::{TerminalView, TerminalAtom},
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
use {
|
use {
|
||||||
crate::core::View,
|
crate::core::View,
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, Weak, RwLock}
|
sync::{Arc, Weak}
|
||||||
}
|
},
|
||||||
|
std::sync::RwLock
|
||||||
};
|
};
|
||||||
|
|
||||||
/*\
|
/*\
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
use {
|
use {
|
||||||
std::sync::{Arc, RwLock},
|
std::sync::Arc,
|
||||||
|
std::any::Any,
|
||||||
|
std::sync::RwLock,
|
||||||
crate::core::{
|
crate::core::{
|
||||||
View,
|
View,
|
||||||
Observer,
|
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> {
|
impl<V: View + ?Sized> View for RwLock<V> {
|
||||||
type Msg = V::Msg;
|
type Msg = V::Msg;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::sync::Arc,
|
||||||
sync::{Arc, RwLock}
|
|
||||||
},
|
|
||||||
cgmath::{Point2, Vector2},
|
cgmath::{Point2, Vector2},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
View,
|
View,
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
pub use {
|
pub use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
boxed::Box
|
boxed::Box
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
View,
|
View,
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
pub use {
|
pub use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
boxed::Box
|
boxed::Box
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
View,
|
View,
|
||||||
|
|
|
@ -4,9 +4,10 @@ pub mod map_key;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
ops::Deref,
|
ops::Deref,
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::core::View
|
crate::core::View
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::{Arc},
|
||||||
collections::HashSet
|
collections::HashSet
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
cgmath::Point2,
|
cgmath::Point2,
|
||||||
crate::{
|
crate::{
|
||||||
core::{ViewPort, Observer, ObserverExt, ObserverBroadcast, InnerViewPort, OuterViewPort},
|
core::{ViewPort, Observer, ObserverExt, ObserverBroadcast, InnerViewPort, OuterViewPort},
|
||||||
|
|
|
@ -14,9 +14,8 @@ pub mod leveled_term_view;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
async_std::{task},
|
async_std::{task},
|
||||||
std::{
|
std::sync::{Arc},
|
||||||
sync::{Arc, RwLock}
|
std::sync::RwLock,
|
||||||
},
|
|
||||||
cgmath::{Vector2, Point2},
|
cgmath::{Vector2, Point2},
|
||||||
termion::event::{Event, Key},
|
termion::event::{Event, Key},
|
||||||
crate::{
|
crate::{
|
||||||
|
|
|
@ -2,11 +2,12 @@ use {
|
||||||
std::{
|
std::{
|
||||||
cmp::{max},
|
cmp::{max},
|
||||||
any::Any,
|
any::Any,
|
||||||
sync::{Arc, RwLock, Weak}
|
sync::{Arc, Weak},
|
||||||
},
|
},
|
||||||
async_std::{
|
async_std::{
|
||||||
stream::StreamExt
|
stream::StreamExt
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{View, Observer, ObserverExt, OuterViewPort, channel::{channel, ChannelData, ChannelSender, ChannelReceiver}},
|
core::{View, Observer, ObserverExt, OuterViewPort, channel::{channel, ChannelData, ChannelSender, ChannelReceiver}},
|
||||||
singleton::{SingletonView},
|
singleton::{SingletonView},
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
use {
|
use {
|
||||||
async_std::stream::StreamExt,
|
async_std::stream::StreamExt,
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, Weak, RwLock},
|
sync::{Arc, Weak},
|
||||||
collections::{HashMap, HashSet}
|
collections::{HashMap, HashSet}
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
View, Observer, ObserverExt, ObserverBroadcast,
|
View, Observer, ObserverExt, ObserverBroadcast,
|
||||||
|
|
|
@ -22,9 +22,10 @@ pub trait SequenceView : View<Msg = usize> {
|
||||||
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
ops::{Deref}
|
ops::{Deref}
|
||||||
};
|
};
|
||||||
|
use std::sync::RwLock;
|
||||||
|
|
||||||
impl<V: SequenceView + ?Sized> SequenceView for RwLock<V> {
|
impl<V: SequenceView + ?Sized> SequenceView for RwLock<V> {
|
||||||
type Item = V::Item;
|
type Item = V::Item;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock}
|
sync::Arc
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
View, Observer, ObserverExt, ObserverBroadcast,
|
View, Observer, ObserverExt, ObserverBroadcast,
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
ops::{Deref, DerefMut}
|
ops::{Deref, DerefMut}
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{View, Observer, ObserverExt, ObserverBroadcast, ViewPort, InnerViewPort, OuterViewPort},
|
core::{View, Observer, ObserverExt, ObserverBroadcast, ViewPort, InnerViewPort, OuterViewPort},
|
||||||
sequence::SequenceView,
|
sequence::SequenceView,
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock}
|
sync::{Arc}
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{
|
core::{
|
||||||
Observer,
|
Observer,
|
||||||
|
|
|
@ -3,9 +3,10 @@ pub mod buffer;
|
||||||
|
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
ops::Deref
|
ops::Deref
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
crate::core::{View}
|
crate::core::{View}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::sync::RwLock,
|
||||||
sync::{RwLock}
|
|
||||||
},
|
|
||||||
crate::{
|
crate::{
|
||||||
core::{ViewPort, OuterViewPort},
|
core::{ViewPort, OuterViewPort},
|
||||||
singleton::{SingletonView, SingletonBuffer},
|
singleton::{SingletonView, SingletonBuffer},
|
||||||
|
@ -101,12 +99,13 @@ impl StringEditor {
|
||||||
pub mod insert_view {
|
pub mod insert_view {
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
cmp::{min, max},
|
cmp::{min, max},
|
||||||
any::Any,
|
any::Any,
|
||||||
collections::HashSet
|
collections::HashSet
|
||||||
},
|
},
|
||||||
cgmath::Point2,
|
cgmath::Point2,
|
||||||
|
std::sync::RwLock,
|
||||||
crate::{
|
crate::{
|
||||||
core::{View, Observer, ObserverExt, ObserverBroadcast, OuterViewPort, InnerViewPort},
|
core::{View, Observer, ObserverExt, ObserverBroadcast, OuterViewPort, InnerViewPort},
|
||||||
terminal::{TerminalAtom, TerminalStyle, TerminalView},
|
terminal::{TerminalAtom, TerminalStyle, TerminalView},
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, Weak, RwLock},
|
sync::{Arc, Weak},
|
||||||
collections::HashMap
|
collections::HashMap
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
cgmath::Point2,
|
cgmath::Point2,
|
||||||
crate::{
|
crate::{
|
||||||
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast},
|
core::{InnerViewPort, OuterViewPort, Observer, ObserverExt, ObserverBroadcast},
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
use {
|
use {
|
||||||
std::{
|
std::{
|
||||||
sync::{Arc, RwLock},
|
sync::Arc,
|
||||||
io::{Write, stdout, stdin},
|
io::{Write, stdout, stdin},
|
||||||
collections::HashSet
|
collections::HashSet
|
||||||
},
|
},
|
||||||
|
std::sync::RwLock,
|
||||||
async_std::{
|
async_std::{
|
||||||
stream::StreamExt,
|
stream::StreamExt,
|
||||||
task
|
task
|
||||||
|
|
Loading…
Reference in a new issue