File tree Expand file tree Collapse file tree 5 files changed +23
-12
lines changed Expand file tree Collapse file tree 5 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ impl AsyncCommitFiles {
57
57
58
58
{
59
59
let current = self . current . lock ( ) ?;
60
- if let Some ( ref c) = * current {
60
+ if let Some ( c) = & * current {
61
61
if c. 0 == id {
62
62
return Ok ( ( ) ) ;
63
63
}
@@ -68,9 +68,9 @@ impl AsyncCommitFiles {
68
68
let sender = self . sender . clone ( ) ;
69
69
let arc_pending = Arc :: clone ( & self . pending ) ;
70
70
71
- rayon_core:: spawn ( move || {
72
- arc_pending. fetch_add ( 1 , Ordering :: Relaxed ) ;
71
+ self . pending . fetch_add ( 1 , Ordering :: Relaxed ) ;
73
72
73
+ rayon_core:: spawn ( move || {
74
74
Self :: fetch_helper ( id, arc_current)
75
75
. expect ( "failed to fetch" ) ;
76
76
@@ -92,9 +92,15 @@ impl AsyncCommitFiles {
92
92
) -> Result < ( ) > {
93
93
let res = sync:: get_commit_files ( CWD , id) ?;
94
94
95
+ log:: trace!(
96
+ "get_commit_files: {} ({})" ,
97
+ id. to_string( ) ,
98
+ res. len( )
99
+ ) ;
100
+
95
101
{
96
- let mut last = arc_current. lock ( ) ?;
97
- * last = Some ( Request ( id, res) ) ;
102
+ let mut current = arc_current. lock ( ) ?;
103
+ * current = Some ( Request ( id, res) ) ;
98
104
}
99
105
100
106
Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -109,9 +109,10 @@ impl AsyncDiff {
109
109
let arc_last = Arc :: clone ( & self . last ) ;
110
110
let sender = self . sender . clone ( ) ;
111
111
let arc_pending = Arc :: clone ( & self . pending ) ;
112
- rayon_core:: spawn ( move || {
113
- arc_pending. fetch_add ( 1 , Ordering :: Relaxed ) ;
114
112
113
+ self . pending . fetch_add ( 1 , Ordering :: Relaxed ) ;
114
+
115
+ rayon_core:: spawn ( move || {
115
116
let notify = AsyncDiff :: get_diff_helper (
116
117
params,
117
118
arc_last,
Original file line number Diff line number Diff line change @@ -117,16 +117,18 @@ impl AsyncLog {
117
117
let arc_pending = Arc :: clone ( & self . pending ) ;
118
118
let arc_background = Arc :: clone ( & self . background ) ;
119
119
120
+ self . pending . store ( true , Ordering :: Relaxed ) ;
121
+
120
122
rayon_core:: spawn ( move || {
121
123
scope_time ! ( "async::revlog" ) ;
122
124
123
- arc_pending. store ( true , Ordering :: Relaxed ) ;
124
125
AsyncLog :: fetch_helper (
125
126
arc_current,
126
127
arc_background,
127
128
& sender,
128
129
)
129
130
. expect ( "failed to fetch" ) ;
131
+
130
132
arc_pending. store ( false , Ordering :: Relaxed ) ;
131
133
132
134
Self :: notify ( & sender) ;
Original file line number Diff line number Diff line change @@ -116,9 +116,10 @@ impl AsyncStatus {
116
116
let arc_pending = Arc :: clone ( & self . pending ) ;
117
117
let status_type = params. status_type ;
118
118
let include_untracked = params. include_untracked ;
119
- rayon_core:: spawn ( move || {
120
- arc_pending. fetch_add ( 1 , Ordering :: Relaxed ) ;
121
119
120
+ self . pending . fetch_add ( 1 , Ordering :: Relaxed ) ;
121
+
122
+ rayon_core:: spawn ( move || {
122
123
Self :: fetch_helper (
123
124
status_type,
124
125
include_untracked,
Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ impl AsyncTags {
74
74
let arc_last = Arc :: clone ( & self . last ) ;
75
75
let sender = self . sender . clone ( ) ;
76
76
let arc_pending = Arc :: clone ( & self . pending ) ;
77
- rayon_core:: spawn ( move || {
78
- arc_pending. fetch_add ( 1 , Ordering :: Relaxed ) ;
79
77
78
+ self . pending . fetch_add ( 1 , Ordering :: Relaxed ) ;
79
+
80
+ rayon_core:: spawn ( move || {
80
81
let notify = AsyncTags :: getter ( arc_last)
81
82
. expect ( "error getting tags" ) ;
82
83
You can’t perform that action at this time.
0 commit comments