Update last_cb_run after we call the cb.

Makes sure we don't fall into cascading calls to the cb
if it takes longer to complete then the interval set.
This commit is contained in:
Joris Vink 2013-12-09 11:40:59 +01:00
parent 10aa4a28fe
commit 02351e1ab4

View File

@ -263,8 +263,8 @@ kore_worker_entry(struct kore_worker *kw)
if (kore_cb != NULL && kore_cb_worker != -1 &&
kore_cb_worker == worker->id) {
if ((now - last_cb_run) >= kore_cb_interval) {
last_cb_run = now;
kore_cb();
last_cb_run = now;
}
}