|
|
|
@ -383,6 +383,7 @@ Core::Core()
|
|
|
|
|
hotkey_set = false;
|
|
|
|
|
HotkeyMutex = 0;
|
|
|
|
|
HotkeyCond = 0;
|
|
|
|
|
misc_data_mutex=0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
bool Core::Init()
|
|
|
|
@ -437,6 +438,7 @@ bool Core::Init()
|
|
|
|
|
HotkeyMutex = new mutex();
|
|
|
|
|
HotkeyCond = new condition_variable();
|
|
|
|
|
thread * HK = new thread(fHKthread, (void *) temp);
|
|
|
|
|
misc_data_mutex=new mutex();
|
|
|
|
|
started = true;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -471,17 +473,28 @@ std::string Core::getHotkeyCmd( void )
|
|
|
|
|
|
|
|
|
|
void Core::RegisterData(void *p,std::string key)
|
|
|
|
|
{
|
|
|
|
|
misc_data_mutex->lock();
|
|
|
|
|
misc_data_map[key]=p;
|
|
|
|
|
misc_data_mutex->unlock();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void *Core::GetData(std::string key)
|
|
|
|
|
{
|
|
|
|
|
misc_data_mutex->lock();
|
|
|
|
|
std::map<std::string,void*>::iterator it=misc_data_map.find(key);
|
|
|
|
|
|
|
|
|
|
if (it!=misc_data_map.end())
|
|
|
|
|
return misc_data_map[key];
|
|
|
|
|
{
|
|
|
|
|
void *p=it->second;
|
|
|
|
|
misc_data_mutex->unlock();
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
misc_data_mutex->unlock();
|
|
|
|
|
return 0;// or throw an error.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Core::Suspend()
|
|
|
|
|
{
|
|
|
|
|