@@ -22,11 +22,11 @@ proc gitdir {} {
22
22
# run before X event handlers, so reading from a fast source can
23
23
# make the GUI completely unresponsive.
24
24
proc run args {
25
- global isonrunq runq
25
+ global isonrunq runq currunq
26
26
27
27
set script $args
28
28
if {[info exists isonrunq($script )]} return
29
- if {$runq eq {}} {
29
+ if {$runq eq {} && ![ info exists currunq] } {
30
30
after idle dorunq
31
31
}
32
32
lappend runq [list {} $script ]
@@ -38,10 +38,10 @@ proc filerun {fd script} {
38
38
}
39
39
40
40
proc filereadable {fd script} {
41
- global runq
41
+ global runq currunq
42
42
43
43
fileevent $fd readable {}
44
- if {$runq eq {}} {
44
+ if {$runq eq {} && ![ info exists currunq] } {
45
45
after idle dorunq
46
46
}
47
47
lappend runq [list $fd $script ]
@@ -60,17 +60,19 @@ proc nukefile {fd} {
60
60
}
61
61
62
62
proc dorunq {} {
63
- global isonrunq runq
63
+ global isonrunq runq currunq
64
64
65
65
set tstart [clock clicks -milliseconds]
66
66
set t0 $tstart
67
67
while {[llength $runq ] > 0} {
68
68
set fd [lindex $runq 0 0]
69
69
set script [lindex $runq 0 1]
70
+ set currunq [lindex $runq 0]
71
+ set runq [lrange $runq 1 end]
70
72
set repeat [eval $script ]
73
+ unset currunq
71
74
set t1 [clock clicks -milliseconds]
72
75
set t [expr {$t1 - $t0 }]
73
- set runq [lrange $runq 1 end]
74
76
if {$repeat ne {} && $repeat } {
75
77
if {$fd eq {} || $repeat == 2} {
76
78
# script returns 1 if it wants to be readded
0 commit comments