Lines Matching refs:mWorkers
151 uint32_t idx = (uint32_t)android_atomic_inc(&dc->mWorkers.mLaunchCount); in HelperThreadProc()
155 dc->mWorkers.mLaunchSignals[idx].init(); in HelperThreadProc()
156 dc->mWorkers.mNativeThreadId[idx] = gettid(); in HelperThreadProc()
168 int ret = syscall(241, rsc->mWorkers.mNativeThreadId[idx], in HelperThreadProc()
174 dc->mWorkers.mLaunchSignals[idx].wait(); in HelperThreadProc()
175 if (dc->mWorkers.mLaunchCallback) { in HelperThreadProc()
176 dc->mWorkers.mLaunchCallback(dc->mWorkers.mLaunchData, idx); in HelperThreadProc()
178 android_atomic_dec(&dc->mWorkers.mRunningCount); in HelperThreadProc()
179 dc->mWorkers.mCompleteSignal.set(); in HelperThreadProc()
189 dc->mWorkers.mLaunchData = data; in rsdLaunchThreads()
190 dc->mWorkers.mLaunchCallback = cbk; in rsdLaunchThreads()
191 android_atomic_release_store(dc->mWorkers.mCount, &dc->mWorkers.mRunningCount); in rsdLaunchThreads()
192 for (uint32_t ct = 0; ct < dc->mWorkers.mCount; ct++) { in rsdLaunchThreads()
193 dc->mWorkers.mLaunchSignals[ct].set(); in rsdLaunchThreads()
195 while (android_atomic_acquire_load(&dc->mWorkers.mRunningCount) != 0) { in rsdLaunchThreads()
196 dc->mWorkers.mCompleteSignal.wait(); in rsdLaunchThreads()
239 dc->mWorkers.mCount = (uint32_t)cpu; in rsdHalInit()
240 dc->mWorkers.mThreadId = (pthread_t *) calloc(dc->mWorkers.mCount, sizeof(pthread_t)); in rsdHalInit()
241 dc->mWorkers.mNativeThreadId = (pid_t *) calloc(dc->mWorkers.mCount, sizeof(pid_t)); in rsdHalInit()
242 dc->mWorkers.mLaunchSignals = new Signal[dc->mWorkers.mCount]; in rsdHalInit()
243 dc->mWorkers.mLaunchCallback = NULL; in rsdHalInit()
245 dc->mWorkers.mCompleteSignal.init(); in rsdHalInit()
247 android_atomic_release_store(dc->mWorkers.mCount, &dc->mWorkers.mRunningCount); in rsdHalInit()
248 android_atomic_release_store(0, &dc->mWorkers.mLaunchCount); in rsdHalInit()
257 for (uint32_t ct=0; ct < dc->mWorkers.mCount; ct++) { in rsdHalInit()
258 status = pthread_create(&dc->mWorkers.mThreadId[ct], &threadAttr, HelperThreadProc, rsc); in rsdHalInit()
260 dc->mWorkers.mCount = ct; in rsdHalInit()
265 while (android_atomic_acquire_load(&dc->mWorkers.mRunningCount) != 0) { in rsdHalInit()
276 for (uint32_t ct=0; ct < dc->mWorkers.mCount; ct++) { in SetPriority()
277 setpriority(PRIO_PROCESS, dc->mWorkers.mNativeThreadId[ct], priority); in SetPriority()
288 dc->mWorkers.mLaunchData = NULL; in Shutdown()
289 dc->mWorkers.mLaunchCallback = NULL; in Shutdown()
290 android_atomic_release_store(dc->mWorkers.mCount, &dc->mWorkers.mRunningCount); in Shutdown()
291 for (uint32_t ct = 0; ct < dc->mWorkers.mCount; ct++) { in Shutdown()
292 dc->mWorkers.mLaunchSignals[ct].set(); in Shutdown()
296 for (uint32_t ct = 0; ct < dc->mWorkers.mCount; ct++) { in Shutdown()
297 status = pthread_join(dc->mWorkers.mThreadId[ct], &res); in Shutdown()
299 rsAssert(android_atomic_acquire_load(&dc->mWorkers.mRunningCount) == 0); in Shutdown()