Hi,
I am currently working on a small wrapper class for boost thread but I dont really get how the sleep function works, this is what I have got so far:
BaseThread::BaseThread(){
thread = boost::thread();
bIsActive = true;
}
BaseThread::~BaseThread(){
join();
}
void BaseThread::join(){
thread.join();
}
void BaseThread::sleep(uint32 _msecs){
if(bIsActive)
boost::this_thread::sleep(boost::posix_time::milliseconds(_msecs));
}
This is how I implemented it so far but I dont really understand how the static this_thread::sleep method knows which thread to sleep if for example multiple instances of my thread wrapper are active. Is this the right way to implement it?