本文整理汇总了C++中Ndb::getCustomData方法的典型用法代码示例。如果您正苦于以下问题:C++ Ndb::getCustomData方法的具体用法?C++ Ndb::getCustomData怎么用?C++ Ndb::getCustomData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ndb
的用法示例。
在下文中一共展示了Ndb::getCustomData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: closeAll
void NdbPool::closeAll() {
lock();
while(list) {
Ndb *n = list;
list = (Ndb *) n->getCustomData();
delete n;
}
size = 0;
unlock();
}
示例2: lock
Ndb * NdbPool::getNdb() {
Ndb * n;
lock();
if(list) {
n = list;
list = (Ndb *) n->getCustomData();
size--;
}
else {
n = new Ndb(conn);
n->init();
created++;
}
unlock();
return n;
}
示例3: runV2MultiWait_WaitPop_Thread
/* Consumer */
int runV2MultiWait_WaitPop_Thread(NDBT_Context* ctx, NDBT_Step* step)
{
static int iter = 0; // keeps incrementing when test case is repeated
int records = ctx->getNumRecords();
const char * d[5] = { " fast"," slow"," slow",""," slow" };
const int timeout[3] = { 100, 1, 0 };
const int pct_wait[9] = { 0,0,0,50,50,50,100,100,100 };
for (int loop = 0; loop < V2_NLOOPS; loop++, iter++)
{
ctx->incProperty("LOOP");
ndbout << "V2 test: " << d[loop&1] << d[loop&2] << d[loop&4];
ndbout << " " << timeout[iter%3] << "/" << pct_wait[iter%9] << endl;
bool slow = loop & 4;
int nrec = 0;
while(nrec < records)
{
/* Occasionally check with no timeout */
global_poll_group->wait(timeout[iter%3], pct_wait[iter%9]);
Ndb * ndb = global_poll_group->pop();
while(ndb)
{
check(ndb->pollNdb(0, 1) != 0, (*ndb));
nrec++;
NdbTransaction *tx = (NdbTransaction *) ndb->getCustomData();
tx->close();
global_ndb_pool->recycleNdb(ndb);
ndb = global_poll_group->pop();
}
if(slow)
{
NdbSleep_MilliSleep(myRandom48(6));
}
}
}
ctx->stopTest();
global_ndb_pool->closeAll();
return NDBT_OK;
}