本文整理汇总了C++中Locker::unlock方法的典型用法代码示例。如果您正苦于以下问题:C++ Locker::unlock方法的具体用法?C++ Locker::unlock怎么用?C++ Locker::unlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locker
的用法示例。
在下文中一共展示了Locker::unlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rasterModelChanged
void OpenRasterUIComponent::rasterModelChanged() {
Locker<const AbstractRasterModel> rasterModel = MainWindow::instance()->rasterModelForRead();
bool isUsable = rasterModel() ? rasterModel()->isUsable() : false;
rasterModel.unlock();
/* Enable "close raster" only if map view and raster is available */
closeRasterAction->setEnabled(MainWindow::instance()->mapView() && isUsable);
}
示例2: wait
void CondVar::wait(Locker &l)
{
Service *pService = Service::getFiberService();
if (pService)
{
l.unlock();
m_blocks.put(pService->m_running);
pService->switchtonext();
l.lock();
}
}
示例3: thread_insert
//MultThread Insert
void* thread_insert(void *arg)
{
printf("thread_insert....\n");
//printf("thread_insert pid is %lu\n",(unsigned long)pthread_self());
Locker* testLock = (Locker *)arg;
testLock->lock(testLock);
//pthread_mutex_lock(&mylock);
if(0 == gddlink_update)
{
pthread_cond_signal(&cond);
}
gddlink_update=1;
InsertDDLink(&L,&num[global_count%10]);
printf("Insert element %d\n",num[global_count%10]);
//pthread_mutex_unlock(&mylock);
testLock->unlock(testLock);
//return &estatus;
pthread_exit(NULL);
}
示例4: thread_display
//MultThread Display
void* thread_display(void *arg)
{
printf("thread_dispaly....\n");
//printf("thread_dispaly pid is %lu\n",(unsigned long)pthread_self());
//pthread_mutex_lock(&mylock);
Locker* testLock = (Locker *)arg;
testLock->lock(testLock);
while(0 == gddlink_update)
{
//pthread_cond_wait(&cond, &mylock);
pthread_cond_wait(&cond, testLock->getlock(testLock));
}
gddlink_update=0;
//printf("Disply DDLink,Global is %d\n",global_count);
DDLinkForeach(&L, DDLinkForeachPrint,print_int);
//pthread_mutex_unlock(&mylock);
testLock->unlock(testLock);
printf("\n");
//return &estatus;
pthread_exit(NULL);
}