SListEntry* SListImpl::flush()
		{
			ScopedLock lock(getDetail(this)->lock);
			SListEntry* result = getDetail(this)->head;
			getDetail(this)->head = NULL;
			return result;
		}
		SListEntry* SListImpl::pop()
		{
			ScopedLock lock(getDetail(this)->lock);
			SListEntry* result = getDetail(this)->head;
			if( result != NULL )
				getDetail(this)->head = result->mNext;
			return result;
		}
		SListImpl::SListImpl()
		{
			getDetail(this)->head = NULL;
			
#if defined(USE_MUTEX)
			pthread_mutex_init(&getDetail(this)->lock, NULL);
#else
			getDetail(this)->lock = 0; // 0 == unlocked
#endif
		}
		SListImpl::~SListImpl()
		{
#if defined(USE_MUTEX)
			pthread_mutex_destroy(&getDetail(this)->lock); 
#endif
		}
		void SListImpl::push(SListEntry* entry)
		{
			ScopedLock lock(getDetail(this)->lock);
			entry->mNext = getDetail(this)->head;
			getDetail(this)->head = entry;
		}
Example #7
0
	SListEntry* SListImpl::flush()
	{
		return reinterpret_cast<SListEntry*>(InterlockedFlushSList(getDetail(this)));
	}
Example #8
0
	SListEntry* SListImpl::pop()
	{
		return reinterpret_cast<SListEntry*>(InterlockedPopEntrySList(getDetail(this)));
	}
Example #9
0
	void SListImpl::push(SListEntry* entry)
	{
		InterlockedPushEntrySList(getDetail(this), reinterpret_cast<SLIST_ENTRY*>(entry));
	}
Example #10
0
	SListImpl::SListImpl()
	{
		InitializeSListHead(getDetail(this));
	}