/**
 *
 * @param {SignalHandler[]} handlers
 * @param {function} f
 * @param {*} ctx
 * @returns {number} index of the handler, or -1 if not found
 */
export function findSignalHandlerIndexByHandleAndContext(handlers, f, ctx) {
    const l = handlers.length;

    for (let i = 0; i < l; i++) {
        const handler = handlers[i];

        if (handler.handle === f && handler.context === ctx) {
            return i;
        }

    }

    return -1;
}