4520a7c383
Events need to be cancelled when an fd is released, to avoid possible memory leaks or use after free. When the event is cancelled, its callback is called. Currently this is sufficient since events are used for resource management and we have no option but to release the lock or memory. If future uses need to distinguish between the callback firing and a cancel, they can look at the timestamp passed to the callback, which will be before the timestamp they expected. Otherwise a separate cancel callback can be added.