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()
303 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_create_Impl()
304 osl_thread_destruct_Impl (&pImpl); in osl_thread_create_Impl()
310 while (pImpl->m_Flags & THREADIMPL_FLAGS_STARTUP) in osl_thread_create_Impl()
313 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_thread_create_Impl()
314 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_thread_create_Impl()
318 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_thread_create_Impl()
320 return ((oslThread)(pImpl)); in osl_thread_create_Impl()
373 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_resumeThread() local
375 OSL_ASSERT(pImpl); in osl_resumeThread()
376 if (!pImpl) in osl_resumeThread()
379 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_resumeThread()
381 if (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_resumeThread()
384 pImpl->m_Flags &= ~THREADIMPL_FLAGS_SUSPENDED; in osl_resumeThread()
385 pthread_cond_signal (&(pImpl->m_Cond)); in osl_resumeThread()
388 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_resumeThread()
396 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_suspendThread() local
398 OSL_ASSERT(pImpl); in osl_suspendThread()
399 if (!pImpl) in osl_suspendThread()
402 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_suspendThread()
404 pImpl->m_Flags |= THREADIMPL_FLAGS_SUSPENDED; in osl_suspendThread()
406 if (pthread_equal (pthread_self(), pImpl->m_hThread)) in osl_suspendThread()
409 while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_suspendThread()
412 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_suspendThread()
413 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_suspendThread()
418 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_suspendThread()
427 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_isThreadRunning() local
429 if (!pImpl) in osl_isThreadRunning()
432 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_isThreadRunning()
433 active = ((pImpl->m_Flags & THREADIMPL_FLAGS_ACTIVE) > 0); in osl_isThreadRunning()
434 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_isThreadRunning()
446 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_joinWithThread() local
448 if (!pImpl) in osl_joinWithThread()
451 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_joinWithThread()
453 if (pthread_equal (pthread_self(), pImpl->m_hThread)) in osl_joinWithThread()
456 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_joinWithThread()
460 thread = pImpl->m_hThread; in osl_joinWithThread()
461 attached = ((pImpl->m_Flags & THREADIMPL_FLAGS_ATTACHED) > 0); in osl_joinWithThread()
462 pImpl->m_Flags &= ~THREADIMPL_FLAGS_ATTACHED; in osl_joinWithThread()
464 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_joinWithThread()
485 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_terminateThread() local
487 OSL_ASSERT(pImpl); in osl_terminateThread()
488 if (!pImpl) in osl_terminateThread()
491 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_terminateThread()
493 if (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_terminateThread()
496 pImpl->m_Flags &= ~THREADIMPL_FLAGS_SUSPENDED; in osl_terminateThread()
497 pthread_cond_signal (&(pImpl->m_Cond)); in osl_terminateThread()
500 pImpl->m_Flags |= THREADIMPL_FLAGS_TERMINATE; in osl_terminateThread()
502 pthread_mutex_unlock (&(pImpl->m_Lock)); in osl_terminateThread()
511 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_scheduleThread() local
513 OSL_ASSERT(pImpl); in osl_scheduleThread()
514 if (!pImpl) in osl_scheduleThread()
517 OSL_ASSERT(pthread_equal (pthread_self(), pImpl->m_hThread)); in osl_scheduleThread()
518 if (!(pthread_equal (pthread_self(), pImpl->m_hThread))) in osl_scheduleThread()
522 pthread_mutex_lock (&(pImpl->m_Lock)); in osl_scheduleThread()
524 while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) in osl_scheduleThread()
527 pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); in osl_scheduleThread()
528 pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); in osl_scheduleThread()
532 terminate = ((pImpl->m_Flags & THREADIMPL_FLAGS_TERMINATE) > 0); in osl_scheduleThread()
534 pthread_mutex_unlock(&(pImpl->m_Lock)); in osl_scheduleThread()
694 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_getThreadIdentifier() local
697 if (pImpl) in osl_getThreadIdentifier()
698 Ident = pImpl->m_Ident; in osl_getThreadIdentifier()
814 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_setThreadPriority() local
816 OSL_ASSERT(pImpl); in osl_setThreadPriority()
817 if (!pImpl) in osl_setThreadPriority()
824 if (pthread_getschedparam(pImpl->m_hThread, &policy, &Param) != 0) in osl_setThreadPriority()
875 if ((nRet = pthread_setschedparam(pImpl->m_hThread, policy, &Param)) != 0) in osl_setThreadPriority()
896 Thread_Impl* pImpl= (Thread_Impl*)Thread; in osl_getThreadPriority() local
898 OSL_ASSERT(pImpl); in osl_getThreadPriority()
899 if (!pImpl) in osl_getThreadPriority()
904 if (pthread_getschedparam(pImpl->m_hThread, &Policy, &Param) != 0) in osl_getThreadPriority()