|
@@ -667,7 +667,7 @@ class AsynPool(_pool.Pool):
|
|
pass
|
|
pass
|
|
self.on_inqueue_close = on_inqueue_close
|
|
self.on_inqueue_close = on_inqueue_close
|
|
|
|
|
|
- def schedule_writes(ready_fds, curindex=[0]):
|
|
+ def schedule_writes(ready_fds, total_write_count=[0]):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -675,17 +675,18 @@ class AsynPool(_pool.Pool):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
-
|
|
+
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
- total = len(ready_fds)
|
|
+ num_ready = len(ready_fds)
|
|
|
|
|
|
- for i in range(total):
|
|
+ for i in range(num_ready):
|
|
- ready_fd = ready_fds[curindex[0] % total]
|
|
+ ready_fd = ready_fds[total_write_count[0] % num_ready]
|
|
- curindex[0] += 1
|
|
+ total_write_count[0] += 1
|
|
if ready_fd in active_writes:
|
|
if ready_fd in active_writes:
|
|
|
|
|
|
continue
|
|
continue
|