• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/libpthread-105.1.4/kern/

Lines Matching refs:thread

80 #include <kern/thread.h>
115 extern void thread_set_cthreadself(thread_t thread, uint64_t pself, int isLP64);
253 * Pre-fault the first page of the new thread's stack and the page that will
370 /* Set thread QoS class if requested. */
498 /* Unspecified threads means the kernel wants us to impose legacy upon the thread. */
571 /* Static param the thread, we just set QoS on it, so its stuck in QoS land now. */
598 * Drop all outstanding overrides on this thread, done outside the wq lock
632 /* If we have main-thread QoS then we don't allow a thread to come out of QOS_CLASS_UNSPECIFIED. */
698 thread_t thread = current_thread();
702 struct threadlist *tl = util_get_thread_threadlist_entry(thread);
709 kr = pthread_kern->thread_policy_set_internal(thread, THREAD_EXTENDED_POLICY, (thread_policy_t)&extpol, THREAD_EXTENDED_POLICY_COUNT);
763 /* The only failure case here is if we pass a tid and have it lookup the thread, we pass the uthread, so this all always succeeds. */
834 /* The only failure case here is if we pass a tid and have it lookup the thread, we pass the uthread, so this all always succeeds. */
984 * was being updated... treat a failed update as a busy thread since
994 * because the update of the timestamp when a thread blocks isn't
998 * time... just treat this as a busy thread since it must have just blocked.
1103 * check for conditions under which we would not add a thread, either
1167 * wakeup the thread hung up in workqueue_exit or workqueue_add_timer waiting for this timer
1224 * when creating the new thread and then retakes it before
1227 * if none found, we just return... the newly created thread
1274 workqueue_callback(int type, thread_t thread)
1280 uth = pthread_kern->get_bsdthread_info(thread);
1304 * if we collide with another thread trying to update the last_blocked (really unlikely
1305 * since another thread would have to get scheduled and then block after we start down
1316 * another thread
1325 PTHREAD_TRACE1(TRACE_wq_thread_block | DBG_FUNC_START, wq, old_activecount, tl->th_priority, start_timer, thread_tid(thread));
1334 * the thread lock for the thread being UNBLOCKED
1339 PTHREAD_TRACE1(TRACE_wq_thread_block | DBG_FUNC_END, wq, wq->wq_threads_scheduled, tl->th_priority, 0, thread_tid(thread));
1372 * blocked thread on wakeup for termination will
1373 * not access the thread list as it is going to be
1389 * thread was created, but never used...
1406 * drop our ref on the thread
1416 * dropped and retaken around thread creation
1442 * if we're not creating this thread to service an overcommit request,
1443 * then check the size of the constrained thread pool... if we've already
1704 * we're at the max thread limit... as existing threads
1724 /* reset signal mask on the workqueue thread to default state */
1818 * Conditions: Called by the last thread in the process.
1852 * drop our last ref on the thread
1904 workqueue_run_nextreq(proc_t p, struct workqueue *wq, thread_t thread,
1921 PTHREAD_TRACE(TRACE_wq_run_nextitem|DBG_FUNC_START, wq, thread, wq->wq_thidlecount, wq->wq_reqcount, 0);
1923 if (thread != THREAD_NULL) {
1924 uth = pthread_kern->get_bsdthread_info(thread);
1927 panic("wq thread with no threadlist");
1936 * the thread is associated with and the priorty based
1945 if (thread != THREAD_NULL) {
1946 th_to_run = thread;
1958 if (wq->wq_ocrequests[priclass] && (thread != THREAD_NULL || wq->wq_thidlecount)) {
1975 * if we get here, the work should be handled by a constrained thread
1980 * constrained threads... just return or park the thread...
1985 if ((th_to_park = thread) == THREAD_NULL)
2003 if (thread != THREAD_NULL) {
2006 * dont't count this thread as currently active
2014 * we found at least 1 thread in the
2027 if ((th_to_park = thread) == THREAD_NULL) {
2034 if (thread != THREAD_NULL) {
2036 * thread is non-NULL here when we return from userspace
2037 * in workq_kernreturn, rather than trying to find a thread
2038 * we pick up new work for this specific thread.
2040 th_to_run = thread;
2059 * and an idle thread, so activate a thread and then
2107 * thread's new disposition w/r to priority
2124 /* Set the QoS tier on the thread, along with the ceiling of max importance for this class. */
2130 /* All the previous implementation here now boils down to setting the QoS policy on the thread. */
2137 * if current thread is reused for work request, does not return via unix_syscall
2139 wq_runreq(p, overcommit, pthread_priority_from_class_index(priclass), th_to_run, tl, reuse_thread, wake_thread, (thread == th_to_run));
2156 PTHREAD_TRACE(TRACE_wq_run_nextitem|DBG_FUNC_END, wq, thread_tid(thread), start_timer, 2, 0);
2162 * this is a workqueue thread with no more
2200 PTHREAD_TRACE(TRACE_wq_run_nextitem | DBG_FUNC_END, wq, thread_tid(thread), 0, 3, 0);
2224 * most likely a normal resume of this thread occurred...
2225 * it's also possible that the thread was aborted after we
2228 * the thread on the path to self-destruction
2236 * an abort of this thread (process is crashing)
2244 * thread has been aborted while still on our idle
2253 * this thread was aborted after we started making
2269 * we have finished setting up the thread's context...
2271 * where the thread will self destruct
2295 * a normal wakeup of this thread occurred... no need
2322 * started to make this a runnable thread,
2337 * we have finished setting up the thread's context
2395 * since thread_resume locks the thread via a full mutex
2415 * the thread priority used to be stored anyway.
2511 thread_t thread = current_thread();
2512 *retval = thread_tid(thread);