Exemple #1
0
uint64 ZTS_Umbrella::pAllocateID(ZRef<ZTS> iTS)
	{
	for (;;)
		{
		uint64 theID;
		size_t countIssued;
		iTS->AllocateIDs(1, theID, countIssued);
		if (countIssued)
			return theID;
		}
	}
Exemple #2
0
bool ZTSoup::AllocateIDs(size_t iCount, uint64& oBaseID, size_t& oCountIssued)
	{
	ZMutexLocker locker_TSWatcher(fMutex_TSWatcher);
	ZRef<ZTSWatcher> theTSWatcher = fTSWatcher;
	if (!theTSWatcher)
		return false;
	locker_TSWatcher.Release();

	if (theTSWatcher->AllocateIDs(iCount, oBaseID, oCountIssued))
		return true;

	locker_TSWatcher.Acquire();
	fTSWatcher.Clear();

	oCountIssued = 0;
	return false;
	}