Skip to content
Snippets Groups Projects
Commit ffa21ad3 authored by Sergey Linev's avatar Sergey Linev Committed by Philippe Canal
Browse files

webgui: introduce TWebWindow::Run(double) method

It allows to run webwindow functionality in non-main thread.
When no connection exists - just do sleep for specified time.
Should be regularly called
parent fa70de09
No related branches found
No related tags found
No related merge requests found
......@@ -210,6 +210,8 @@ public:
void Sync();
void Run(double tm = 0.);
bool Show(const std::string &where = "");
bool CanSend(unsigned connid, bool direct = true);
......
......@@ -44,9 +44,9 @@ private:
std::string fAddr; ///<! HTTP address of the server
std::mutex fMutex; ///<! main mutex to protect
int fMutexBooked{0}; ///<! flag indicating that mutex is booked for some long operation
std::thread::id fBookedThrd; ///<! thread where mutex is booked, can be reused
std::thread::id fBookedThrd; ///<! thread where mutex is booked, can be reused
unsigned fIdCnt{0}; ///<! counter for identifiers
// std::list<std::shared_ptr<TWebWindow>> fDisplays; ///<! list of existing displays (not used at the moment)
unsigned fIdCnt{0}; ///<! counter for identifiers
bool CreateHttpServer(bool with_http = false);
......
......@@ -773,3 +773,16 @@ int ROOT::Experimental::TWebWindow::WaitFor(WebWindowWaitFunc_t check, double ti
{
return fMgr->WaitFor(*this, check, timelimit);
}
/////////////////////////////////////////////////////////////////////////////////
/// Run window functionality for specified time
/// If no action can be performed - just sleep specified time
void ROOT::Experimental::TWebWindow::Run(double tm)
{
if (tm <= 0) {
Sync();
} else {
WaitFor([](double) { return 0; }, tm);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment