Fix INVARIANTS support

This commit is contained in:
Sebastian Huber
2017-05-18 09:35:46 +02:00
parent 5be4f06fa8
commit 62c8ca0ead
10 changed files with 138 additions and 195 deletions

View File

@@ -2108,8 +2108,10 @@ static void
kqueue_destroy(struct kqueue *kq)
{
#ifndef __rtems__
KASSERT(kq->kq_fdp == NULL,
("kqueue still attached to a file descriptor"));
#endif /* __rtems__ */
seldrain(&kq->kq_sel);
knlist_destroy(&kq->kq_sel.si_note);
mtx_destroy(&kq->kq_lock);

View File

@@ -84,8 +84,10 @@ lock_init(struct lock_object *lock, struct lock_class *class, const char *name,
int i;
/* Check for double-init and zero object. */
#ifndef __rtems__
KASSERT(flags & LO_NEW || !lock_initialized(lock),
("lock \"%s\" %p already initialized", name, lock));
#endif /* __rtems__ */
/* Look up lock class to find its index. */
for (i = 0; i < LOCK_CLASS_MAX; i++)