Added console server app. First try. Depends on qt for locale-specific stuff. Cannot start a game yet, only join is possible. Cannot run multiple games yet.

Not yet as service/daemon, because testing is easier with a simple console app.
This commit is contained in:
lotodore
2007-07-30 23:22:58 +00:00
parent 5d13dd7803
commit f11998c28c
12 changed files with 374 additions and 33 deletions
+17 -7
View File
@@ -86,14 +86,24 @@ Thread::Join(unsigned msecTimeout)
if (!IsRunning())
return true;
// Calculate time after timeout
boost::xtime t;
boost::xtime_get(&t, boost::TIME_UTC);
ADD_MSEC_TO_XTIME(t, msecTimeout);
bool tmpIsTerminated;
if (msecTimeout == THREAD_WAIT_INFINITE)
{
// Wait infinitely.
boost::timed_mutex::scoped_lock lock(m_isTerminatedMutex);
tmpIsTerminated = true;
}
else
{
// Calculate time after timeout
boost::xtime t;
boost::xtime_get(&t, boost::TIME_UTC);
ADD_MSEC_TO_XTIME(t, msecTimeout);
// Wait for the termination of the application code.
boost::timed_mutex::scoped_timed_lock lock(m_isTerminatedMutex, t);
bool tmpIsTerminated = lock.locked();
// Wait for the termination of the application code.
boost::timed_mutex::scoped_timed_lock lock(m_isTerminatedMutex, t);
tmpIsTerminated = lock.locked();
}
if (tmpIsTerminated)
{
+2
View File
@@ -29,6 +29,8 @@
#define NANOSECONDS_PER_SECOND 1000000000
#endif
#define THREAD_WAIT_INFINITE 0xFFFFFFFF
class Thread
{
public: