diff options
Diffstat (limited to 'frontends/beos/schedule.cpp')
-rw-r--r-- | frontends/beos/schedule.cpp | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/frontends/beos/schedule.cpp b/frontends/beos/schedule.cpp index e96e56d81..7877a838b 100644 --- a/frontends/beos/schedule.cpp +++ b/frontends/beos/schedule.cpp @@ -28,11 +28,7 @@ extern "C" { #include "netsurf/content_type.h" #include "netsurf/browser_window.h" -#ifdef DEBUG_BEOS_SCHEDULE #include "utils/log.h" -#else -#define LOG(x...) -#endif } /** Killable callback closure embodiment. */ @@ -58,7 +54,10 @@ nsbeos_schedule_kill_callback(void *_target, void *_match) _nsbeos_callback_t *match = (_nsbeos_callback_t *)_match; if ((target->callback == match->callback) && (target->context == match->context)) { - LOG("Found match for %p(%p), killing.", target->callback, target->context); + NSLOG(schedule, DEBUG, + "Found match for %p(%p), killing.", + target->callback, + target->context); target->callback = NULL; target->context = NULL; target->callback_killed = true; @@ -69,7 +68,9 @@ nsbeos_schedule_kill_callback(void *_target, void *_match) static void schedule_remove(void (*callback)(void *p), void *p) { - LOG("schedule_remove() for %p(%p)", cb->callback, cb->context); + NSLOG(schedule, DEBUG, + "schedule_remove() for %p(%p)", + callback, p); if (callbacks == NULL) return; _nsbeos_callback_t cb_match; @@ -81,7 +82,7 @@ schedule_remove(void (*callback)(void *p), void *p) nserror beos_schedule(int t, void (*callback)(void *p), void *p) { - LOG("t:%d cb:%p p:%p", t, cb->callback, cb->context); + NSLOG(schedule, DEBUG, "t:%d cb:%p p:%p", t, callback, p); if (callbacks == NULL) { callbacks = new BList; @@ -111,7 +112,7 @@ nserror beos_schedule(int t, void (*callback)(void *p), void *p) bool schedule_run(void) { - LOG("schedule_run()"); + NSLOG(schedule, DEBUG, "schedule_run()"); earliest_callback_timeout = B_INFINITE_TIMEOUT; if (callbacks == NULL) @@ -120,7 +121,9 @@ schedule_run(void) bigtime_t now = system_time(); int32 i; - LOG("Checking %ld callbacks to for deadline.", this_run->CountItems()); + NSLOG(schedule, DEBUG, + "Checking %ld callbacks to for deadline.", + callbacks->CountItems()); /* Run all the callbacks which made it this far. */ for (i = 0; i < callbacks->CountItems(); ) { @@ -132,7 +135,11 @@ schedule_run(void) i++; continue; } - LOG("Running callbacks %p(%p).", cb->callback, cb->context); + NSLOG(schedule, DEBUG, + "Running callbacks %p(%p).", + cb->callback, + cb->context); + if (!cb->callback_killed) cb->callback(cb->context); callbacks->RemoveItem(cb); |