aboutsummaryrefslogtreecommitdiff
path: root/src/game/MapUpdater.h
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-17 07:34:00 +0100
committern0n4m3 <none@none>2009-12-17 07:34:00 +0100
commit2028f0658b2bb95e2390aba8fd995271fe4e41d6 (patch)
tree0b468a4234b90588e7b7e799b7581b57800add2d /src/game/MapUpdater.h
parent8507b7da9902303189e9d01c8c23d1aaf8d656bd (diff)
Removed mtmaps OpenMP
Implement mtmaps based on ACE For stable work MapUpdate.Threads=2 in config --HG-- branch : trunk
Diffstat (limited to 'src/game/MapUpdater.h')
-rw-r--r--src/game/MapUpdater.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/game/MapUpdater.h b/src/game/MapUpdater.h
new file mode 100644
index 00000000000..3909569e163
--- /dev/null
+++ b/src/game/MapUpdater.h
@@ -0,0 +1,36 @@
+#ifndef _MAP_UPDATER_H_INCLUDED
+#define _MAP_UPDATER_H_INCLUDED
+
+#include <ace/Thread_Mutex.h>
+#include <ace/Condition_Thread_Mutex.h>
+
+#include "DelayExecutor.h"
+
+class Map;
+
+class MapUpdater
+{
+ public:
+ MapUpdater();
+ virtual ~MapUpdater();
+
+ friend class MapUpdateRequest;
+
+ int schedule_update(Map& map, ACE_UINT32 diff);
+
+ int wait();
+
+ int activate(size_t num_threads);
+
+ int deactivate(void);
+
+ bool activated();
+ private:
+ void update_finished();
+
+ DelayExecutor m_executor;
+ ACE_Condition_Thread_Mutex m_condition;
+ ACE_Thread_Mutex m_mutex;
+ size_t pedning_requests;
+};
+#endif //_MAP_UPDATER_H_INCLUDED