Newer
Older
Import / projects / Gameloft / glwebtools / include / glwebtools / os / glwebtools_condition.h
@John John on 29 Dec 2020 954 bytes bulk import from macbookpro checkouts
#pragma once
#ifndef _GLWEBTOOLS_CONDITION_INCLUDED_
#define _GLWEBTOOLS_CONDITION_INCLUDED_

#include <glwebtools/internal/glwebtools_common.h>

namespace glwebtools
{
	class Mutex;

	class Condition : public NonCopyable
	{
	public:
		Condition(Mutex& mutex);
		~Condition(); 

		/*! Unblocks at least one of the threads that are blocked on the specified 
		 condition variable cond (if any threads are blocked on cond). 
		*/
		glwebtools::Error Signal();

		/*! Unblocks at least one of the threads that are blocked on the specified 
		 condition variable cond (if any threads are blocked on cond). 
		*/
		/*! Unblocks all threads currently blocked on the specified condition variable cond.
		*/
		glwebtools::Error Broadcast();


		//! wait on a condition in ms
		glwebtools::Error Wait(unsigned int time = 0);

	private:
		void* m_handler;
	};

}//namespace glwebtools

#endif //_GLWEBTOOLS_CONDITION_INCLUDED_