static void _epoll_on_close(oe_fd_t* epoll_, int fd)
{
    epoll_t* const epoll = _cast_epoll(epoll_);
    oe_assert(epoll);

    oe_assert(fd >= 0);

    oe_mutex_lock(&epoll->lock);

    /* Delete the mapping if it exists. */
    for (size_t i = 0; i < epoll->map_size; i++)
    {
        if (epoll->map[i].fd == fd)
        {
            /* Swap with last element of array. */
            epoll->map[i] = epoll->map[--epoll->map_size];
            break;
        }
    }

    oe_mutex_unlock(&epoll->lock);
}
static void _epoll_on_close(oe_fd_t* epoll_, int fd)
{
    epoll_t* const epoll = _cast_epoll(epoll_);
    oe_assert(epoll);

    oe_assert(fd >= 0);

    oe_mutex_lock(&epoll->lock);

     
    for (size_t i = 0; i < epoll->map_size; i++)
    {
        if (epoll->map[i].fd == fd)
        {
             
            epoll->map[i] = epoll->map[--epoll->map_size];
            break;
        }
    }

    oe_mutex_unlock(&epoll->lock);
}