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

Method waitForResponse

examples/MultiThreading/b3Win32ThreadSupport.cpp:115–147  ·  view source on GitHub ↗

check for messages from SPUs

Source from the content-addressed store, hash-verified

113
114///check for messages from SPUs
115void b3Win32ThreadSupport::waitForResponse(int* puiArgument0, int* puiArgument1)
116{
117 ///We should wait for (one of) the first tasks to finish (or other SPU messages), and report its response
118
119 ///A possible response can be 'yes, SPU handled it', or 'no, please do a PPU fallback'
120
121 b3Assert(m_activeThreadStatus.size());
122
123 int last = -1;
124#ifndef SINGLE_THREADED
125 DWORD res = WaitForMultipleObjects(m_completeHandles.size(), &m_completeHandles[0], FALSE, INFINITE);
126 b3Assert(res != WAIT_FAILED);
127 last = res - WAIT_OBJECT_0;
128
129 b3ThreadStatus& threadStatus = m_activeThreadStatus[last];
130 b3Assert(threadStatus.m_threadHandle);
131 b3Assert(threadStatus.m_eventCompletetHandle);
132
133 //WaitForSingleObject(threadStatus.m_eventCompletetHandle, INFINITE);
134 b3Assert(threadStatus.m_status > 1);
135 threadStatus.m_status = 0;
136
137 ///need to find an active spu
138 b3Assert(last >= 0);
139
140#else
141 last = 0;
142 b3ThreadStatus& threadStatus = m_activeThreadStatus[last];
143#endif //SINGLE_THREADED
144
145 *puiArgument0 = threadStatus.m_taskId;
146 *puiArgument1 = threadStatus.m_status;
147}
148
149///check for messages from SPUs
150bool b3Win32ThreadSupport::isTaskCompleted(int* puiArgument0, int* puiArgument1, int timeOutInMilliseconds)

Callers 2

exitPhysicsMethod · 0.45
mainFunction · 0.45

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected