@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -13,11 +13,10 @@ * file. */ #include "config.h" -#include #include #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFArray.h" @@ -272,11 +271,11 @@ * handler called -[cancelAsyncRequests]. */ OFList OF_GENERIC(OF_KINDOF(OFRunLoopReadQueueItem *)) *queue = [[_readQueues objectForKey: object] retain]; - assert(queue != nil); + OFAssert(queue != nil); @try { if (![queue.firstObject handleObject: object]) { OFListItem listItem = queue.firstListItem; @@ -316,11 +315,11 @@ * Retain the queue so that it doesn't disappear from us because the * handler called -[cancelAsyncRequests]. */ OFList *queue = [[_writeQueues objectForKey: object] retain]; - assert(queue != nil); + OFAssert(queue != nil); @try { if (![queue.firstObject handleObject: object]) { OFListItem listItem = queue.firstListItem; @@ -1326,11 +1325,11 @@ if (state == nil) return; if ((queue = [state->_writeQueues objectForKey: object]) != nil) { - assert(queue.count > 0); + OFAssert(queue.count > 0); /* * Clear the queue now, in case this has been called from a * handler, as otherwise, we'd do the cleanups below twice. */ @@ -1339,11 +1338,11 @@ [state->_kernelEventObserver removeObjectForWriting: object]; [state->_writeQueues removeObjectForKey: object]; } if ((queue = [state->_readQueues objectForKey: object]) != nil) { - assert(queue.count > 0); + OFAssert(queue.count > 0); /* * Clear the queue now, in case this has been called from a * handler, as otherwise, we'd do the cleanups below twice. */ @@ -1613,10 +1612,11 @@ [state->_timersQueueMutex unlock]; } #endif if (timer.valid) { + [timer of_reschedule]; [timer fire]; return; } }