Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3805689
D111.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
869 B
Referenced Files
None
Subscribers
None
D111.diff
View Options
diff --git a/Wearg/Broker.tcl b/Wearg/Broker.tcl
--- a/Wearg/Broker.tcl
+++ b/Wearg/Broker.tcl
@@ -28,8 +28,26 @@
utimer 4 [namespace current]::on_tick
}
+ # Determines if we're in a risk to receive a SIGCHLD while the broker intercepts signals
+ #
+ # @param time The specified unixtime, or the current one if omitted
+ # @return 1 if the risk is there, 0 if it shouldn't be risky
+ proc near_SIGCHLD_arrival {{time ""}} {
+ if {$time == ""} {
+ set time [clock seconds]
+ }
+ set timePosition [expr $time % 300]
+ expr $timePosition == 0 || $timePosition == 299
+ }
+
proc on_tick {} {
- get_messages
+ if {![near_SIGCHLD_arrival]} {
+ # We generally want to get messages, but not
+ # when the SIGCHLD signal is sent to the bot
+ # which seems to be every five minutes.
+
+ get_messages
+ }
utimer 1 [namespace current]::on_tick
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 1, 03:44 (22 h, 51 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2274013
Default Alt Text
D111.diff (869 B)
Attached To
Mode
D111: Bypass message queue when it risks a collision with SIGCHLD.
Attached
Detach File
Event Timeline
Log In to Comment