Lines Matching refs:pImpl

166 	Thread_Impl* pImpl = malloc (sizeof(Thread_Impl));  in osl_thread_construct_Impl()  local
167 if (pImpl) in osl_thread_construct_Impl()
169 memset (pImpl, 0, sizeof(Thread_Impl)); in osl_thread_construct_Impl()
171 pthread_mutex_init (&(pImpl->m_Lock), PTHREAD_MUTEXATTR_DEFAULT); in osl_thread_construct_Impl()
172 pthread_cond_init (&(pImpl->m_Cond), PTHREAD_CONDATTR_DEFAULT); in osl_thread_construct_Impl()
174 return (pImpl); in osl_thread_construct_Impl()
201 Thread_Impl* pImpl= (Thread_Impl*)pData; in osl_thread_cleanup_Impl() local
203 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_thread_cleanup_Impl()
205 thread = pImpl->m_hThread; in osl_thread_cleanup_Impl()
206 attached = (pImpl->m_Flags & THREADIMPL_FLAGS_ATTACHED) != 0; in osl_thread_cleanup_Impl()
207 destroyed = (pImpl->m_Flags & THREADIMPL_FLAGS_DESTROYED) != 0; in osl_thread_cleanup_Impl()
208 pImpl->m_Flags &= ~(THREADIMPL_FLAGS_ACTIVE | THREADIMPL_FLAGS_ATTACHED); in osl_thread_cleanup_Impl()
210 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_cleanup_Impl()
222 osl_thread_destruct_Impl (&pImpl); in osl_thread_cleanup_Impl()
232 Thread_Impl* pImpl= (Thread_Impl*)pData; in osl_thread_start_Impl() local
234 OSL_ASSERT(pImpl); in osl_thread_start_Impl()
236 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_thread_start_Impl()
242 pImpl->m_Ident = insertThreadId (pImpl->m_hThread); in osl_thread_start_Impl()
245 pImpl->m_Flags &= ~THREADIMPL_FLAGS_STARTUP; in osl_thread_start_Impl()
246 pImpl->m_Flags |= THREADIMPL_FLAGS_ACTIVE; in osl_thread_start_Impl()
247 pthread_cond_signal (&(pImpl->m_Cond)); in osl_thread_start_Impl()
250 while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_thread_start_Impl()
253 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_thread_start_Impl()
254 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_thread_start_Impl()
259 terminate = ((pImpl->m_Flags & THREADIMPL_FLAGS_TERMINATE) > 0); in osl_thread_start_Impl()
261 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_start_Impl()
266 pImpl->m_WorkerFunction(pImpl->m_pData); in osl_thread_start_Impl()
282 Thread_Impl* pImpl; in osl_thread_create_Impl() local
285 pImpl = osl_thread_construct_Impl(); in osl_thread_create_Impl()
286 if (!pImpl) in osl_thread_create_Impl()
289 pImpl->m_WorkerFunction = pWorker; in osl_thread_create_Impl()
290 pImpl->m_pData = pThreadData; in osl_thread_create_Impl()
291 pImpl->m_Flags = nFlags | THREADIMPL_FLAGS_STARTUP; in osl_thread_create_Impl()
293 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_thread_create_Impl()
296 &(pImpl->m_hThread), in osl_thread_create_Impl()
299 (void*)(pImpl))) != 0) in osl_thread_create_Impl()
304 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_create_Impl()
305 osl_thread_destruct_Impl (&pImpl); in osl_thread_create_Impl()
311 while (pImpl->m_Flags & THREADIMPL_FLAGS_STARTUP) in osl_thread_create_Impl()
314 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_thread_create_Impl()
315 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_thread_create_Impl()
319 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_create_Impl()
321 return ((oslThread)(pImpl)); in osl_thread_create_Impl()
374 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_resumeThread() local
376 OSL_ASSERT(pImpl); in osl_resumeThread()
377 if (!pImpl) in osl_resumeThread()
380 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_resumeThread()
382 if (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_resumeThread()
385 pImpl->m_Flags &= ~THREADIMPL_FLAGS_SUSPENDED; in osl_resumeThread()
386 pthread_cond_signal (&(pImpl->m_Cond)); in osl_resumeThread()
389 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_resumeThread()
397 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_suspendThread() local
399 OSL_ASSERT(pImpl); in osl_suspendThread()
400 if (!pImpl) in osl_suspendThread()
403 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_suspendThread()
405 pImpl->m_Flags |= THREADIMPL_FLAGS_SUSPENDED; in osl_suspendThread()
407 if (pthread_equal (pthread_self(), pImpl->m_hThread)) in osl_suspendThread()
410 while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_suspendThread()
413 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_suspendThread()
414 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_suspendThread()
419 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_suspendThread()
428 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_isThreadRunning() local
430 if (!pImpl) in osl_isThreadRunning()
433 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_isThreadRunning()
434 active = ((pImpl->m_Flags & THREADIMPL_FLAGS_ACTIVE) > 0); in osl_isThreadRunning()
435 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_isThreadRunning()
447 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_joinWithThread() local
449 if (!pImpl) in osl_joinWithThread()
452 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_joinWithThread()
454 if (pthread_equal (pthread_self(), pImpl->m_hThread)) in osl_joinWithThread()
457 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_joinWithThread()
461 thread = pImpl->m_hThread; in osl_joinWithThread()
462 attached = ((pImpl->m_Flags & THREADIMPL_FLAGS_ATTACHED) > 0); in osl_joinWithThread()
463 pImpl->m_Flags &= ~THREADIMPL_FLAGS_ATTACHED; in osl_joinWithThread()
465 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_joinWithThread()
486 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_terminateThread() local
488 OSL_ASSERT(pImpl); in osl_terminateThread()
489 if (!pImpl) in osl_terminateThread()
492 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_terminateThread()
494 if (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_terminateThread()
497 pImpl->m_Flags &= ~THREADIMPL_FLAGS_SUSPENDED; in osl_terminateThread()
498 pthread_cond_signal (&(pImpl->m_Cond)); in osl_terminateThread()
501 pImpl->m_Flags |= THREADIMPL_FLAGS_TERMINATE; in osl_terminateThread()
503 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_terminateThread()
512 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_scheduleThread() local
514 OSL_ASSERT(pImpl); in osl_scheduleThread()
515 if (!pImpl) in osl_scheduleThread()
518 OSL_ASSERT(pthread_equal (pthread_self(), pImpl->m_hThread)); in osl_scheduleThread()
519 if (!(pthread_equal (pthread_self(), pImpl->m_hThread))) in osl_scheduleThread()
523 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_scheduleThread()
525 while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_scheduleThread()
528 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_scheduleThread()
529 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_scheduleThread()
533 terminate = ((pImpl->m_Flags & THREADIMPL_FLAGS_TERMINATE) > 0); in osl_scheduleThread()
535 pthread_mutex_unlock(&(pImpl->m_Lock)); in osl_scheduleThread()
695 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_getThreadIdentifier() local
698 if (pImpl) in osl_getThreadIdentifier()
699 Ident = pImpl->m_Ident; in osl_getThreadIdentifier()
815 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_setThreadPriority() local
817 OSL_ASSERT(pImpl); in osl_setThreadPriority()
818 if (!pImpl) in osl_setThreadPriority()
825 if (pthread_getschedparam(pImpl->m_hThread, &policy, &Param) != 0) in osl_setThreadPriority()
876 if ((nRet = pthread_setschedparam(pImpl->m_hThread, policy, &Param)) != 0) in osl_setThreadPriority()
897 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_getThreadPriority() local
899 OSL_ASSERT(pImpl); in osl_getThreadPriority()
900 if (!pImpl) in osl_getThreadPriority()
905 if (pthread_getschedparam(pImpl->m_hThread, &Policy, &Param) != 0) in osl_getThreadPriority()