Skip to content

Commit 17147c3

Browse files
committed
---
yaml --- r: 101919 b: refs/heads/master c: 9c05c1c h: refs/heads/master i: 101917: 5cc4158 101915: ad43709 101911: 8302be4 101903: c7ae22c 101887: 60c9d6b v: v3
1 parent 41dfa48 commit 17147c3

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 47c31831a38bc2307234e54a48ad3bf071058ade
2+
refs/heads/master: 9c05c1c2366e286275c2320995ed5066bff08dd7
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/libstd/comm/shared.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ impl<T: Send> Packet<T> {
305305
// See the discussion in the stream implementation for why we we
306306
// might decrement steals.
307307
Some(data) => {
308-
self.steals += 1;
309308
if self.steals > MAX_STEALS {
310309
match self.cnt.swap(0, atomics::SeqCst) {
311310
DISCONNECTED => {
@@ -314,11 +313,12 @@ impl<T: Send> Packet<T> {
314313
n => {
315314
let m = cmp::min(n, self.steals);
316315
self.steals -= m;
317-
self.cnt.fetch_add(n - m, atomics::SeqCst);
316+
self.bump(n - m);
318317
}
319318
}
320319
assert!(self.steals >= 0);
321320
}
321+
self.steals += 1;
322322
Ok(data)
323323
}
324324

trunk/src/libstd/comm/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ impl<T: Send> Packet<T> {
213213
// down as much as possible (without going negative), and then
214214
// adding back in whatever we couldn't factor into steals.
215215
Some(data) => {
216-
self.steals += 1;
217216
if self.steals > MAX_STEALS {
218217
match self.cnt.swap(0, atomics::SeqCst) {
219218
DISCONNECTED => {
@@ -222,11 +221,12 @@ impl<T: Send> Packet<T> {
222221
n => {
223222
let m = cmp::min(n, self.steals);
224223
self.steals -= m;
225-
self.cnt.fetch_add(n - m, atomics::SeqCst);
224+
self.bump(n - m);
226225
}
227226
}
228227
assert!(self.steals >= 0);
229228
}
229+
self.steals += 1;
230230
match data {
231231
Data(t) => Ok(t),
232232
GoUp(up) => Err(Upgraded(up)),

0 commit comments

Comments
 (0)