Skip to content

Commit 41a2126

Browse files
committed
---
yaml --- r: 91607 b: refs/heads/auto c: 1bdaea8 h: refs/heads/master i: 91605: e5b5cdb 91603: 2349318 91599: 53b185b v: v3
1 parent 5253268 commit 41a2126

File tree

5 files changed

+15
-33
lines changed

5 files changed

+15
-33
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: f9abd998d6a5368c54162deb0bf187e94e31dc27
16+
refs/heads/auto: 1bdaea827ed957ce404fffee27923e9606584ce0
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustuv/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ impl rtio::RtioTcpStream for TcpWatcher {
313313
impl Drop for TcpWatcher {
314314
fn drop(&mut self) {
315315
let _m = self.fire_missiles();
316-
self.stream.close(true);
316+
self.stream.close();
317317
}
318318
}
319319

branches/auto/src/librustuv/pipe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl HomingIO for PipeWatcher {
136136
impl Drop for PipeWatcher {
137137
fn drop(&mut self) {
138138
let _m = self.fire_missiles();
139-
self.stream.close(true); // close synchronously
139+
self.stream.close();
140140
}
141141
}
142142

branches/auto/src/librustuv/stream.rs

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use std::cast;
1212
use std::libc::{c_int, size_t, ssize_t, c_void};
13-
use std::ptr;
1413
use std::rt::BlockedTask;
1514
use std::rt::local::Local;
1615
use std::rt::sched::Scheduler;
@@ -124,35 +123,23 @@ impl StreamWatcher {
124123

125124
// This will deallocate an internally used memory, along with closing the
126125
// handle (and freeing it).
127-
//
128-
// The `synchronous` flag dictates whether this handle is closed
129-
// synchronously (the task is blocked) or asynchronously (the task is not
130-
// block, but the handle is still deallocated).
131-
pub fn close(&mut self, synchronous: bool) {
132-
if synchronous {
133-
let mut closing_task = None;
134-
unsafe {
135-
uvll::set_data_for_uv_handle(self.handle, &closing_task);
136-
}
126+
pub fn close(&mut self) {
127+
let mut closing_task = None;
128+
unsafe {
129+
uvll::set_data_for_uv_handle(self.handle, &closing_task);
130+
}
137131

138-
// Wait for this stream to close because it possibly represents a remote
139-
// connection which may have consequences if we close asynchronously.
140-
let sched: ~Scheduler = Local::take();
141-
do sched.deschedule_running_task_and_then |_, task| {
142-
closing_task = Some(task);
143-
unsafe { uvll::uv_close(self.handle, close_cb) }
144-
}
145-
} else {
146-
unsafe {
147-
uvll::set_data_for_uv_handle(self.handle, ptr::null::<u8>());
148-
uvll::uv_close(self.handle, close_cb)
149-
}
132+
// Wait for this stream to close because it possibly represents a remote
133+
// connection which may have consequences if we close asynchronously.
134+
let sched: ~Scheduler = Local::take();
135+
do sched.deschedule_running_task_and_then |_, task| {
136+
closing_task = Some(task);
137+
unsafe { uvll::uv_close(self.handle, close_cb) }
150138
}
151139

152140
extern fn close_cb(handle: *uvll::uv_handle_t) {
153141
let data: *c_void = unsafe { uvll::get_data_for_uv_handle(handle) };
154142
unsafe { uvll::free_handle(handle) }
155-
if data.is_null() { return }
156143

157144
let closing_task: &mut Option<BlockedTask> = unsafe {
158145
cast::transmute(data)

branches/auto/src/librustuv/tty.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,8 @@ impl HomingIO for TtyWatcher {
101101
}
102102

103103
impl Drop for TtyWatcher {
104-
// TTY handles are used for the logger in a task, so this destructor is run
105-
// when a task is destroyed. When a task is being destroyed, a local
106-
// scheduler isn't available, so we can't do the normal "take the scheduler
107-
// and resume once close is done". Instead close operations on a TTY are
108-
// asynchronous.
109104
fn drop(&mut self) {
110105
let _m = self.fire_missiles();
111-
self.stream.close(false);
106+
self.stream.close();
112107
}
113108
}

0 commit comments

Comments
 (0)