AZ(pthread_mutex_unlock(&exp_mtx));
}
+void
+EXP_TTLchange(struct object *o)
+{
+ AZ(pthread_mutex_lock(&exp_mtx));
+ binheap_delete(exp_heap, o->heap_idx);
+ binheap_insert(exp_heap, o);
+ AZ(pthread_mutex_unlock(&exp_mtx));
+}
+
/*--------------------------------------------------------------------
* This thread monitors deathrow and kills objects when they time out.
*/
time(&t);
AZ(pthread_mutex_lock(&exp_mtx));
o = binheap_root(exp_heap);
- if (o == NULL || o->ttl - t > expearly) {
+ if (o == NULL || o->ttl > t + expearly) {
AZ(pthread_mutex_unlock(&exp_mtx));
sleep(1);
continue;
AZ(pthread_cond_wait(&o->cv, &oh->mtx));
/* XXX: check TTL */
if (o->ttl == 0) {
- VSL(SLT_Debug, 0, "Object %p had 0 ttl", o);
+ /* Object banned but not reaped yet */
} else if (BAN_CheckObject(o, b)) {
o->ttl = 0;
- VSL(SLT_Debug, 0, "Object %p was banned", o);
+ VSL(SLT_ExpBan, 0, "%u was banned", o->xid);
+ EXP_TTLchange(o);
} else
break;
o->refcnt--;