AIThreadSafe* update.

Updated/added documentation.
Removed AIThreadSafeWindowsHack that annoyed me (fix your compiler).
Don't use 'static' in anonymous namespace.
Use the AIThreadSafe*DC variants for default constructed objects,
as opposed to the AITHREADSAFE* macro's.
This commit is contained in:
Aleric Inglewood
2012-03-16 00:10:07 +01:00
parent d63c54cb78
commit 4391614d6e
9 changed files with 104 additions and 39 deletions

View File

@@ -87,7 +87,7 @@
BOOL gHackGodmode = FALSE;
#endif
AITHREADSAFE(settings_map_type, gSettings,);
AIThreadSafeDC<settings_map_type> gSettings;
LLControlGroup gSavedSettings("Global"); // saved at end of session
LLControlGroup gSavedPerAccountSettings("PerAccount"); // saved at end of session
LLControlGroup gColors("Colors"); // saved at end of session

View File

@@ -51,7 +51,7 @@ extern BOOL gHackGodmode;
void settings_setup_listeners();
typedef std::map<std::string, LLControlGroup*> settings_map_type;
extern AIThreadSafe<settings_map_type> gSettings;
extern AIThreadSafeDC<settings_map_type> gSettings;
// for the graphics settings
void create_graphics_group(LLControlGroup& group);

View File

@@ -65,7 +65,7 @@ AIFilePicker::AIFilePicker(void) : mPluginManager(NULL), mAutoKill(false), mCanc
}
// static
AITHREADSAFESIMPLE(AIFilePicker::context_map_type, AIFilePicker::sContextMap, );
AIThreadSafeSimpleDC<AIFilePicker::context_map_type> AIFilePicker::sContextMap;
// static
void AIFilePicker::store_folder(std::string const& context, std::string const& folder)

View File

@@ -185,7 +185,7 @@ public:
private:
LLPointer<LLViewerPluginManager> mPluginManager; //!< Pointer to the plugin manager.
typedef std::map<std::string, std::string> context_map_type; //!< Type of mContextMap.
static AIThreadSafeSimple<context_map_type> sContextMap; //!< Map context (ie, "snapshot" or "image") to last used folder.
static AIThreadSafeSimpleDC<context_map_type> sContextMap; //!< Map context (ie, "snapshot" or "image") to last used folder.
std::string mContext; //!< Some key to indicate the context (remembers the folder per key).
bool mAutoKill; //!< True if the default behavior is to delete itself after being finished.

View File

@@ -65,18 +65,18 @@ namespace {
};
typedef std::vector<QueueElement> active_statemachines_type;
static active_statemachines_type active_statemachines;
active_statemachines_type active_statemachines;
typedef std::vector<AIStateMachine*> continued_statemachines_type;
struct cscm_type
{
continued_statemachines_type continued_statemachines;
bool calling_mainloop;
};
static AITHREADSAFE(cscm_type, continued_statemachines_and_calling_mainloop, );
AIThreadSafeDC<cscm_type> continued_statemachines_and_calling_mainloop;
}
// static
AITHREADSAFESIMPLE(U64, AIStateMachine::sMaxCount, );
AIThreadSafeSimpleDC<U64> AIStateMachine::sMaxCount;
void AIStateMachine::updateSettings(void)
{

View File

@@ -224,7 +224,7 @@ class AIStateMachine {
};
callback_type* mCallback; //!< Pointer to signal/connection, or NULL when not connected.
static AIThreadSafeSimple<U64> sMaxCount; //!< Number of cpu clocks below which we start a new state machine within the same frame.
static AIThreadSafeSimpleDC<U64> sMaxCount; //!< Number of cpu clocks below which we start a new state machine within the same frame.
protected:
//! State of the derived class. Only valid if mState == bs_run. Call set_state to change.