本文整理汇总了C++中thread::Mutex::unlock方法的典型用法代码示例。如果您正苦于以下问题:C++ Mutex::unlock方法的具体用法?C++ Mutex::unlock怎么用?C++ Mutex::unlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thread::Mutex
的用法示例。
在下文中一共展示了Mutex::unlock方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addExtender
bool ItemJSBinding::addExtender(ChromiumDLL::JavaScriptExtenderI* extender)
{
if (!extender)
return false;
bool found = false;
g_ItemLock.lock();
for (size_t x=0; x<g_vExtenderList.size(); x++)
{
if (g_vExtenderList[x] == extender)
{
found = true;
break;
}
}
if (!found)
g_vExtenderList.push_back(extender);
g_ItemLock.unlock();
return !found;
}
示例2: AddItem
uint32 ItemJSBinding::AddItem(ScriptCoreItemI* item)
{
uint32 hash = UTIL::MISC::RSHash_CSTR(gcString("{0}", (uint64)item));
g_ItemLock.lock();
g_ItemMap[hash] = item;
g_ItemLock.unlock();
return hash;
}
示例3: RemoveItem
void ItemJSBinding::RemoveItem(uint32 itemId)
{
g_ItemLock.lock();
auto it = g_ItemMap.find(itemId);
if (it != g_ItemMap.end())
g_ItemMap.erase(it);
g_ItemLock.unlock();
}
示例4: GetItem
ScriptCoreItemI* ItemJSBinding::GetItem(uint32 itemId)
{
ScriptCoreItemI* ret = NULL;
g_ItemLock.lock();
auto it = g_ItemMap.find(itemId);
if (it != g_ItemMap.end())
ret= it->second;
g_ItemLock.unlock();
return ret;
}
示例5: getRegistrationCode
const char* ItemJSBinding::getRegistrationCode()
{
DesuraJSBase<ItemJSBinding>::getRegistrationCode();
g_ItemLock.lock();
for (size_t x=0; x<g_vExtenderList.size(); x++)
{
const char* code = g_vExtenderList[x]->getRegistrationCode();
m_szRegCode.append(code);
}
g_ItemLock.unlock();
return m_szRegCode.c_str();
}
示例6: execute
JSObjHandle ItemJSBinding::execute(ChromiumDLL::JavaScriptFunctionArgs* args)
{
JSObjHandle ret = DesuraJSBase<ItemJSBinding>::execute(args);
if (!ret->isException() || g_vExtenderList.empty())
return ret;
g_ItemLock.lock();
for (size_t x=0; x<g_vExtenderList.size(); x++)
{
ret = g_vExtenderList[x]->execute(args);
if (!ret->isException())
break;
}
g_ItemLock.unlock();
return ret;
}
示例7: log
void log(const std::string& message)
{
mutex.lock();
os << "logger: " << message << "\n";
mutex.unlock();
}
示例8: needSpecial
void WildcardManager::needSpecial(WCSpecialInfo *info)
{
m_WCMutex.lock();
onNeedSpecialEvent(*info);
m_WCMutex.unlock();
}