Further process tweaks

- Integrates Volundr's btime library and associated process scheduler
changes.
- btime is implemented separately from the process scheduler, as precise
time measurement is also useful elsewhere.
- `TimeOfHour` is no longer internally throttled; throttling is instead
done by `SCHECK`.
- If btime's `gettime` cannot be called at world startup, an error will
be output and the world will stop.
- Retains the change to schedule processes according to game time,
rather than real time.
- Removes the (now unused) update queue files.
- Removes the process scheduler testing files.
- These are standalone tests for the process scheduler, completely
unrelated to its use in the full codebase. We never used them.
- Moves the process scheduler defines into __DEFINES.
- Makes the lighting process run once before the round starts.
- Renames `scheck` to `sleepCheck`, to ensure any code that tries to use
`scheck` will fail to compile.
- Adds `SCHECK` and `SCHECK_EVERY` macros that skip calling `sleepCheck`
entirely until a specified number of `SCHECK`s (50 by default) have been
called.
- Makes most processes iterate using their `last_object` variable,
allowing hang recovery to show the type that caused the hang.
- Makes processes output an error when they filter out a type they
refuse to process.
- Rolls the recently-added alarm subsystem into the alarm process.
- Removes the now unused subsystems code.
This commit is contained in:
Krausus
2015-08-08 09:07:26 -04:00
parent 26d35be764
commit 61edb3eb95
35 changed files with 255 additions and 951 deletions
+8 -8
View File
@@ -1,6 +1,3 @@
var/global/list/object_profiling = list()
/datum/controller/process/obj
/datum/controller/process/obj/setup()
name = "obj"
schedule_interval = 20 // every 2 seconds
@@ -16,13 +13,16 @@ var/global/list/object_profiling = list()
stat(null, "[processing_objects.len] objects")
/datum/controller/process/obj/doWork()
for(var/obj/O in processing_objects)
for(last_object in processing_objects)
var/datum/O = last_object
if(istype(O) && isnull(O.gcDestroyed))
try
O.process()
// Reagent datums get shoved in here, but the process proc isn't on the
// base datum type, so we just call it blindly.
O:process()
catch(var/exception/e)
catchException(e, O)
// Use src explicitly after a try/catch, or BYOND messes src up. I have no idea why.
src.scheck()
SCHECK
else
processing_objects -= O
catchBadType(O)
processing_objects -= O