check for messages from SPUs
| 113 | |
| 114 | ///check for messages from SPUs |
| 115 | void 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 |
| 150 | bool b3Win32ThreadSupport::isTaskCompleted(int* puiArgument0, int* puiArgument1, int timeOutInMilliseconds) |
no test coverage detected