Esempio n. 1
0
/**
 * Remove search handle from the hash table.
 */
static void
sqh_remove(squeue_t *sq, gnet_search_t sh)
{
	const void *key;
	bool found;

	g_assert(sq != NULL);

	found = hset_contains_extended(sq->handles, uint_to_pointer(sh), &key);

	g_assert(found);
	g_assert((gnet_search_t) pointer_to_uint(key) == sh);

	hset_remove(sq->handles, key);
}
Esempio n. 2
0
static bool 
remove_item(hset_t *hs, const struct nid *node_id)
{
	const void *orig_key;

	g_return_val_if_fail(hs, FALSE);
	g_return_val_if_fail(node_id, FALSE);
	
	if (hset_contains_extended(hs, node_id, &orig_key)) {
    	hset_remove(hs, orig_key);
		nid_unref(orig_key);
		return TRUE;
	} else {
		return FALSE;
	}
}