static int unlock_tmap(vm_translation_map *map)
{
	TMAP_TRACE("unlock_tmap: map %p\n", map);

	if(recursive_lock_get_recursion(&map->lock) == 1) {
		// we're about to release it for the last time
	}
	recursive_lock_unlock(&map->lock);
	return 0;
}
/*!	Unlocks the map, and, if we are actually losing the recursive lock,
	flush all pending changes of this map (ie. flush TLB caches as
	needed).
*/
void
M68KVMTranslationMap::Unlock()
{
	TRACE("%p->M68KVMTranslationMap::Unlock()\n", this);

	if (recursive_lock_get_recursion(&fLock) == 1) {
		// we're about to release it for the last time
		Flush();
	}

	recursive_lock_unlock(&fLock);
}
/*!	Acquires the map's recursive lock, and resets the invalidate pages counter
	in case it's the first locking recursion.
*/
bool
M68KVMTranslationMap::Lock()
{
	TRACE("%p->M68KVMTranslationMap::Lock()\n", this);

	recursive_lock_lock(&fLock);
	if (recursive_lock_get_recursion(&fLock) == 1) {
		// we were the first one to grab the lock
		TRACE("clearing invalidated page count\n");
		fInvalidPagesCount = 0;
	}

	return true;
}