I have some extra functions that are running in separate threads. The structure looks like this:
class singleton {personal: boost :: mutex mMutex; Std :: vector & lt; Std :: string & gt; MMessages; Public: Zero AddMessage (const std :: string and msg) {mMutex.lock (); MMessages.push_back (MSG); MMutex.unlock (); } Zero sender () {while (true) {mMutex.lock (); (Size_t i = 0; i & lt; mMessages.size (+; i) {// do something with MMSSE [i]} mMutex.unlock (); }}}; ... int main () {singleton * handle; Handle = singleton :: example (); Promotion: Thread Sender (Promotion :: Tie (& Singleton :: Sender, Handle)); ... ap chakra ...} Sometimes it fails with error: promote ': exception_detail: : Clone_impl & lt; Boost :: exception_detail :: error_info_injector & lt; Promotion :: lock_error & gt; & Gt; 'What (): Promotion: Lock_Error Canceled What could be and why it is most important that you know the reason for the emphasis?
Maybe you have not object singleton Be made! So Mute X is not built either. Try:
int main () {singleton handles; // Object, Pointer Boost :: Thread Sender (Promotion :: Tie (and Singleton :: Sender, and Handle)); ...}
Comments
Post a Comment