Quantcast
Channel: Atomic types and threads - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Dave S for Atomic types and threads

Remove the & from the second argument to bind. You already have a pointer to the object, and that's what you're likely trying to use. Secondly, the pointer is uninitialized which could also be a...

View Article



Answer by Ben Voigt for Atomic types and threads

Why are you passing a Nginx_sender ** (double pointer) to boost::bind? That seems wrong, and would explain why your thread appears to be operating on a second copy of the object than the main thread.

View Article

Atomic types and threads

this is the next step after this topic: Modifying data in threadsclass Nginx_sender{ private: std::atomic_int data; boost::mutex mMutex; void SendMessage(const std::string &msg) { mMutex.lock();...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images