library/src/datastructures/BP-HashTable.cc
// Attempts to checkout a data entry.  This is different than checking out a table in that
// a data entry has no possibility of having children to recurse into.
Attempts to checkout a data entry.  This is different than checking out a table in that
a data entry has no possibility of having children to recurse into.
Attempts to checkout a data entry . This is different than checking out a table in that a data entry has no possibility of having children to recurse into .
BP_ERROR_T BP_HashRegCheckOutData
(
	P_BP_HASH_TABLE_REGISTRY      hreg,
	P_BP_HASH_TABLE_KEYED_ENTRY   data,
	BP_BOOL                       block_till_checkout_established
)
{
	BP_GLOBAL_HASH_TABLE_OVERRIDE(ERR_FAILURE);
	if(!data)
		return ERR_FAILURE;
	if(block_till_checkout_established == BP_TRUE)
	{
		BP_HASH_TABLE_LOCK_SEM(data->lock);
	}
	else
	{
		if
		(
			BP_HASH_TABLE_TRYLOCK_SEM(data->lock) == ERR_SUCCESS
		)
		{
			return ERR_SUCCESS;
		}
		else
		{
			return ERR_FAILURE;
		}
	}
	return ERR_SUCCESS;
}
BP_ERROR_T BP_HashRegCheckOutData ( P_BP_HASH_TABLE_REGISTRY hreg , P_BP_HASH_TABLE_KEYED_ENTRY data , BP_BOOL block_till_checkout_established ) { BP_GLOBAL_HASH_TABLE_OVERRIDE ( ERR_FAILURE ) ; if ( ! data ) return ERR_FAILURE ; if ( block_till_checkout_established == BP_TRUE ) { BP_HASH_TABLE_LOCK_SEM ( data -> lock ) ; } else { if ( BP_HASH_TABLE_TRYLOCK_SEM ( data -> lock ) == ERR_SUCCESS ) { return ERR_SUCCESS ; } else { return ERR_FAILURE ; } } return ERR_SUCCESS ; }
Attempts to checkout a data entry.
Attempts to checkout a data entry .
// macro to override hreg on null // ensure we have data // block until the checkout has been established // blocking semaphore lock (critical section) // check that semaphore is locked // return indicating success // return indicating failure // return indicating success