You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nvidia-texture-tools/src/nvthread/Thread.h

43 lines
819 B
C++

// This code is in the public domain -- castano@gmail.com
#pragma once
#ifndef NV_THREAD_THREAD_H
#define NV_THREAD_THREAD_H
#include "nvthread.h"
#include "nvcore/Ptr.h" // AutoPtr
namespace nv
{
typedef void ThreadFunc(void * arg);
class NVTHREAD_CLASS Thread
{
NV_FORBID_COPY(Thread);
public:
Thread();
Thread(const char * name);
~Thread();
void setName(const char * name);
void start(ThreadFunc * func, void * arg);
void wait();
bool isRunning() const;
static void spinWait(uint count);
static void yield();
static void sleep(uint ms);
static void wait(Thread * threads, uint count);
struct Private;
AutoPtr<Private> p;
};
} // nv namespace
#endif // NV_THREAD_THREAD_H