U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » bug in CoWork since C++11
Re: bug in CoWork since C++11 [message #46796 is a reply to message #46795] Tue, 09 August 2016 11:36 Go to previous messageGo to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
mirek wrote on Tue, 09 August 2016 11:15
Well, the one possible explanation is that your CoWork is global (or static) variable. Is that so?


My CoWork instance is not a global variable. It is a variable as member of a class and it is not a pointer. It is a singleton class, though. I construct it with a private constructor and a GetInstance method.

class X
{
private:
     CoWork mThreadPool;
     X();
public:
     static X* GetInstance()
     {
          static X instance;
          return &instance;
     };
}

[Updated on: Tue, 09 August 2016 11:38]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: how many threads should i use in SkyLark server?
Next Topic: WebSockets non blocking mode?
Goto Forum:
  


Current Time: Fri Oct 09 10:29:35 GMT+2 2026

Total time taken to generate the page: 0.01042 seconds