static inline void mapping_add(int from, int to, long feid, long teid) { tor_add_pair(from, to); evt_add(from, feid); evt_add(to * -1, teid); assert(tor_get_to(from) == to); assert(tor_get_from(to) == from); assert(evt_torrent(feid) == from); assert(evt_torrent(teid) == (-1*to)); }
static inline void mapping_add(int from, int to, long feid, long teid) { long tf, tt; LOCK(); tor_add_pair(from, to, feid, teid); evt_add(from, feid); evt_add(to * -1, teid); assert(tor_get_to(from, &tt) == to); assert(tor_get_from(to, &tf) == from); assert(evt_torrent(feid) == from); assert(evt_torrent(teid) == (-1*to)); assert(tt == teid); assert(tf == feid); UNLOCK(); }