51 pthread_mutexattr_t attr;
52 attr.__align = PTHREAD_MUTEX_ADAPTIVE_NP;
86 struct timespec ts = {0, timeout * 1000};
95 printf(
"%s %i WTF found it i guess count current %lu next %lu\n",
109 memcpy(&i128, &ptr,
sizeof(ptr));
110 memcpy((uint64_t *)&i128+1, &count,
sizeof(count));
122 return *((uint64_t *)&i128+1);
130 mbox(mboxarg),
nodeid(nodeidarg), obBatchMsg(NULL)
145 obBatchMsg=
new class MessageBatchSerialized(nodeid);
169 mytail = __atomic_load_n(&
mbox->
tail, __ATOMIC_SEQ_CST);
173 if (mytail == __atomic_load_n(&
mbox->
tail, __ATOMIC_SEQ_CST))
198 topologyMgrPtr(NULL),
199 userSchemaMgrLocation (),
200 deadlockMgrLocation (),
228 std::swap(*newTop, top);
240 for (
size_t n=0; n < top.
actorList.size(); n++)
247 new class MboxProducer(top.actorList[n].mbox,top.nodeid);
253 case ACTOR_TRANSACTIONAGENT:
262 case ACTOR_TOPOLOGYMGR:
270 case ACTOR_USERSCHEMAMGR:
278 case ACTOR_DEADLOCKMGR:
286 case ACTOR_IBGATEWAY:
289 case ACTOR_OBGATEWAY:
301 printf(
"%s %i unhandled actor type: %i\n", __FILE__, __LINE__,
330 vector< vector<int> > aa = top.
allActors;
375 int64_t partitionid,
class Message &msg)
379 printf(
"%s %i anomaly %li %lu\n", __FILE__, __LINE__, partitionid,
395 for (int16_t n=1; n < (int16_t)
allActors.size(); n++)
397 for (int16_t m=FIRSTACTORID; m < (int16_t)
allActors[n].size(); m++)
406 *nmsg = *((
class Message *)&msg);
407 toActor(source, {n, m}, *nmsg);
415 toActor(source, {n, m}, *nmsg);
423 toActor(source, {n, m}, *nmsg);
431 toActor(source, {n, m}, *nmsg);
440 toActor(source, {n, m}, *nmsg);
449 toActor(source, {n, m}, *nmsg);
454 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,
472 boost::unordered_map< int16_t, vector<int> >::iterator it;
477 for (int16_t m=FIRSTACTORID; m <
482 printf(
"%s %i n m %i %i allActors %i allActorsThisReplica %i\n",
483 __FILE__, __LINE__, it->first, m,
allActors[it->first][m],
491 *nmsg = *((
class Message *)&msg);
492 toActor(source, {it->first, m}, *nmsg);
500 toActor(source, {it->first, m}, *nmsg);
508 toActor(source, {it->first, m}, *nmsg);
516 toActor(source, {it->first, m}, *nmsg);
525 toActor(source, {it->first, m}, *nmsg);
534 toActor(source, {it->first, m}, *nmsg);
539 printf(
"%s %i anomaly %i\n", __FILE__, __LINE__,