+// wxSemaphore: a counter limiting the number of threads concurrently accessing
+// a shared resource
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxSemaphoreInternal;
+class WXDLLEXPORT wxSemaphore
+{
+public:
+ // specifying a maxcount of 0 actually makes wxSemaphore behave as if there
+ // is no upper limit, if maxcount is 1 the semaphore behaves as a mutex
+ wxSemaphore( int initialcount = 0, int maxcount = 0 );
+
+ // dtor is not virtual, don't use this class polymorphically
+ ~wxSemaphore();
+
+ // wait indefinitely, until the semaphore count goes beyond 0
+ // and then decrement it and return (this method might have been called
+ // Acquire())
+ void Wait();
+
+ // same as Wait(), but does not block, returns TRUE if successful and
+ // FALSE if the count is zero
+ bool TryWait();
+
+ // same as Wait(), but as a timeout limit, returns TRUE if the semaphore
+ // was acquired and FALSE if the timeout has ellapsed
+ bool Wait( unsigned long timeout_millis );
+
+ // increments the semaphore count and signals one of the waiting threads
+ void Post();
+
+private:
+ wxSemaphoreInternal *m_internal;
+};
+
+// ----------------------------------------------------------------------------
+// wxThread: class encpasulating a thread of execution