nvidia-texture-tools/src/nvthread/Event.h

35 lines
667 B
C
Raw Normal View History

2011-09-27 17:48:46 +00:00
// This code is in the public domain -- castano@gmail.com
#pragma once
#ifndef NV_THREAD_EVENT_H
#define NV_THREAD_EVENT_H
#include "nvthread.h"
#include "nvcore/Ptr.h"
namespace nv
{
// This is intended to be used by a single waiter thread.
2011-09-27 18:12:32 +00:00
class NVTHREAD_CLASS Event
{
NV_FORBID_COPY(Event);
public:
Event();
~Event();
2011-09-27 17:48:46 +00:00
2011-09-28 01:45:08 +00:00
void post();
void wait(); // Wait resets the event.
2011-09-27 17:48:46 +00:00
static void post(Event * events, uint count);
static void wait(Event * events, uint count);
2011-09-27 18:12:32 +00:00
private:
struct Private;
AutoPtr<Private> m;
};
2011-09-27 17:48:46 +00:00
} // nv namespace
#endif // NV_THREAD_EVENT_H