MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / disconnect

Method disconnect

examples/SharedMemory/PhysicsClientUDP.cpp:562–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void UdpNetworkedPhysicsProcessor::disconnect()
563{
564 if (m_data->m_threadSupport)
565 {
566 m_data->m_cs->lock();
567 m_data->m_cs->setSharedParam(0, eUDPRequestTerminate);
568 m_data->m_cs->unlock();
569
570 int numActiveThreads = 1;
571
572 while (numActiveThreads)
573 {
574 int arg0, arg1;
575 if (m_data->m_threadSupport->isTaskCompleted(&arg0, &arg1, 0))
576 {
577 numActiveThreads--;
578 printf("numActiveThreads = %d\n", numActiveThreads);
579 }
580 else
581 {
582 b3Clock::usleep(1000);
583 }
584 };
585
586 printf("stopping threads\n");
587
588 delete m_data->m_threadSupport;
589 m_data->m_threadSupport = 0;
590 m_data->m_isConnected = false;
591 }
592}
593
594void UdpNetworkedPhysicsProcessor::setTimeOut(double timeOutInSeconds)
595{

Callers

nothing calls this directly

Calls 4

isTaskCompletedMethod · 0.80
lockMethod · 0.45
setSharedParamMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected