condition_variable.hpp #1

  • //
  • guest/
  • ququlala/
  • libsprawl/
  • mainline/
  • threading/
  • condition_variable.hpp
  • View
  • Commits
  • Open Download .zip Download (595 B)
#pragma once

#include "mutex.hpp"
#include <stdint.h>

#ifdef _WIN32
typedef	CONDITION_VARIABLE ConditionVariableType;
#else
typedef pthread_cond_t ConditionVariableType;
#endif

namespace sprawl
{
	namespace threading
	{
		class ConditionVariable;
	}
}

class sprawl::threading::ConditionVariable
{
public:
	ConditionVariable();
	~ConditionVariable();

	void Wait(SharedLock& lock);
	void WaitFor(SharedLock& lock, int64_t nanoseconds);
	void WaitUntil(SharedLock& lock, int64_t nanosecondTimestamp);

	void Notify();
	void NotifyAll();
private:
	ConditionVariableType m_conditionVariable;
};
# Change User Description Committed
#1 23398 ququlala "Forking branch Mainline of shadauxcat-libsprawl to ququlala-libsprawl."
//guest/ShadauxCat/Sprawl/Mainline/threading/condition_variable.hpp
#1 12508 ShadauxCat -Added threading library.
Currently only functional for Linux; Windows will fail to link. (I will fix this soon.)
-Fixed missing move and copy constructors in List and ForwardList
-Fixed broken move constructor in HashMap
-Fixed missing const get() in HashMap
-Fixed broken operator-> in ListIterator
-Added sprawl::noncopyable
-Added sketch headers for filesystem library
-Made StringLiteral hashable, added special hashes for pointers and integers in murmur3
-Fixed compiler warning in async_network
-Updated memory allocators to use new threading library for mutexes
-Added accessibility to sprawl::StringLiteral to be able toa ccess its pointer and length and perform pointer comparisons

#review-12504