comparison OrthancServer/ServerContext.cpp @ 1447:5ba7471780ae

refactoring: HttpToolbox, DumpJson in Lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 17:42:06 +0200
parents 0a3e3be59094
children c0bdc47165ef
comparison
equal deleted inserted replaced
1446:8dc80ba768aa 1447:5ba7471780ae
69 { 69 {
70 void ServerContext::ChangeThread(ServerContext* that) 70 void ServerContext::ChangeThread(ServerContext* that)
71 { 71 {
72 while (!that->done_) 72 while (!that->done_)
73 { 73 {
74 std::auto_ptr<IDynamicObject> obj(that->pendingChanges_.Dequeue(500)); 74 std::auto_ptr<IDynamicObject> obj(that->pendingChanges_.Dequeue(100));
75 75
76 if (obj.get() != NULL) 76 if (obj.get() != NULL)
77 { 77 {
78 const ServerIndexChange& change = dynamic_cast<const ServerIndexChange&>(*obj.get()); 78 const ServerIndexChange& change = dynamic_cast<const ServerIndexChange&>(*obj.get());
79 79
117 117
118 118
119 119
120 ServerContext::~ServerContext() 120 ServerContext::~ServerContext()
121 { 121 {
122 done_ = true; 122 Stop();
123 123 }
124 if (changeThread_.joinable()) 124
125 { 125
126 changeThread_.join(); 126 void ServerContext::Stop()
127 {
128 if (!done_)
129 {
130 done_ = true;
131
132 if (changeThread_.joinable())
133 {
134 changeThread_.join();
135 }
127 } 136 }
128 } 137 }
129 138
130 139
131 void ServerContext::SetCompressionEnabled(bool enabled) 140 void ServerContext::SetCompressionEnabled(bool enabled)