File: arm_dynamic_loop_delay.dpatch

package info (click to toggle)
mldonkey 2.8.1-2etch1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,940 kB
  • ctags: 26,220
  • sloc: ml: 138,666; sh: 15,368; cpp: 12,076; ansic: 8,243; asm: 3,858; xml: 3,367; perl: 1,831; makefile: 259; python: 258
file content (30 lines) | stat: -rw-r--r-- 1,241 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh /usr/share/dpatch/dpatch-run
## arm_dynamic_loop_delay.dpatch by spiralvoice <spiralvoice@hotmail.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Avoid a freeze of mldonkey on arm (cf. #370107).

@DPATCH@
diff -urNad mldonkey-2.7.7~/src/utils/net/basicSocket.ml mldonkey-2.7.7/src/utils/net/basicSocket.ml
--- mldonkey-2.7.7~/src/utils/net/basicSocket.ml	2006-05-17 08:52:44.000000000 +0000
+++ mldonkey-2.7.7/src/utils/net/basicSocket.ml	2006-07-19 22:34:31.000000000 +0000
@@ -513,17 +513,10 @@
         lprintf_nl "[BW1] Resetting bandwidth counters";
       List.iter (fun f -> try f () with _ -> ()) !bandwidth_second_timers
   );
-  let loop_time = ref 0. in
   while true do
     try
-      let time = 
- 	let new_time = update_time () in
- 	let dynamic_loop_delay =  !loop_time +. !loop_delay -. new_time in
-        if dynamic_loop_delay > 0. then begin
- 	  (try select [] dynamic_loop_delay;  with _ -> ());
- 	  update_time ()
- 	end else new_time in
-      loop_time := time;
+      if !loop_delay > 0. then (try select [] !loop_delay;  with _ -> ());
+      let _ = update_time () in
       exec_tasks !fd_tasks;
       exec_hooks !after_select_hooks;
       exec_timers !timers;