@@ -114,7 +114,6 @@ fn run_loop(iotask_ch: chan<iotask>) unsafe {
114
114
// initialize our loop data and store it in the loop
115
115
let data: iotask_loop_data = {
116
116
async_handle: async_handle,
117
- mut active: true ,
118
117
msg_po_ptr: addr_of ( msg_po)
119
118
} ;
120
119
ll:: set_data_for_uv_handle ( async_handle, addr_of ( data) ) ;
@@ -137,7 +136,6 @@ fn run_loop(iotask_ch: chan<iotask>) unsafe {
137
136
// data that lives for the lifetime of the high-evel oo
138
137
type iotask_loop_data = {
139
138
async_handle : * ll:: uv_async_t ,
140
- mut active : bool ,
141
139
msg_po_ptr : * port < iotask_msg >
142
140
} ;
143
141
@@ -158,29 +156,27 @@ crust fn wake_up_cb(async_handle: *ll::uv_async_t,
158
156
async_handle, status) ) ;
159
157
let loop_ptr = ll:: get_loop_for_uv_handle ( async_handle) ;
160
158
let data = ll:: get_data_for_uv_handle ( async_handle) as * iotask_loop_data ;
161
- // FIXME: What is this checking?
162
- if ( * data) . active {
163
- let msg_po = * ( ( * data) . msg_po_ptr ) ;
164
- while msg_po. peek ( ) {
165
- let msg = msg_po. recv ( ) ;
166
- if ( * data) . active {
167
- alt msg {
168
- interaction( cb) {
169
- cb ( loop_ptr) ;
170
- }
171
- teardown_loop {
172
- begin_teardown( data) ;
173
- }
174
- }
175
- } else {
176
- // FIXME: drop msg ?
177
- }
159
+ let msg_po = * ( ( * data) . msg_po_ptr ) ;
160
+ while msg_po. peek ( ) {
161
+ let msg = msg_po. recv ( ) ;
162
+ alt msg {
163
+ interaction( cb) {
164
+ cb ( loop_ptr) ;
165
+ }
166
+ teardown_loop {
167
+ begin_teardown( data) ;
168
+ }
178
169
}
179
- } else {
180
- // loop not active
181
170
}
182
171
}
183
172
173
+ fn begin_teardown ( data : * iotask_loop_data ) unsafe {
174
+ log ( debug, "iotask begin_teardown() called, close async_handle" ) ;
175
+ // call user-suppled before_tear_down cb
176
+ let async_handle = ( * data) . async_handle ;
177
+ ll:: close ( async_handle as * c_void , tear_down_close_cb) ;
178
+ }
179
+
184
180
crust fn tear_down_close_cb ( handle : * ll:: uv_async_t ) unsafe {
185
181
let loop_ptr = ll:: get_loop_for_uv_handle ( handle) ;
186
182
let loop_refs = ll:: loop_refcount ( loop_ptr) ;
@@ -189,13 +185,6 @@ crust fn tear_down_close_cb(handle: *ll::uv_async_t) unsafe {
189
185
assert loop_refs == 1i32 ;
190
186
}
191
187
192
- fn begin_teardown ( data : * iotask_loop_data ) unsafe {
193
- log ( debug, "iotask begin_teardown() called, close async_handle" ) ;
194
- // call user-suppled before_tear_down cb
195
- let async_handle = ( * data) . async_handle ;
196
- ll:: close ( async_handle as * c_void , tear_down_close_cb) ;
197
- }
198
-
199
188
#[ cfg( test) ]
200
189
mod test {
201
190
crust fn async_close_cb ( handle : * ll:: uv_async_t ) unsafe {
0 commit comments