kern_thr.c (c4bd610f58fc4e3e5f3b6093561b0fee645ee2cd) kern_thr.c (740fd64d65cc70e1bfd61ab9e8061eb2d1f39c5d)
1/*-
2 * Copyright (c) 2003, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 162 unchanged lines hidden (view full) ---

171 }
172 } else {
173 /* Set up our machine context. */
174 stack.ss_sp = stack_base;
175 stack.ss_size = stack_size;
176 /* Set upcall address to user thread entry function. */
177 cpu_set_upcall_kse(newtd, start_func, arg, &stack);
178 /* Setup user TLS address and TLS pointer register. */
1/*-
2 * Copyright (c) 2003, Jeffrey Roberson <jeff@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 162 unchanged lines hidden (view full) ---

171 }
172 } else {
173 /* Set up our machine context. */
174 stack.ss_sp = stack_base;
175 stack.ss_size = stack_size;
176 /* Set upcall address to user thread entry function. */
177 cpu_set_upcall_kse(newtd, start_func, arg, &stack);
178 /* Setup user TLS address and TLS pointer register. */
179 cpu_set_user_tls(newtd, tls_base);
179 error = cpu_set_user_tls(newtd, tls_base);
180 if (error != 0) {
181 thread_free(newtd);
182 crfree(td->td_ucred);
183 return (error);
184 }
180 }
181
182 if ((td->td_proc->p_flag & P_HADTHREADS) == 0) {
183 /* Treat initial thread as it has PTHREAD_SCOPE_PROCESS. */
184 p->p_procscopegrp = kg;
185 mtx_lock_spin(&sched_lock);
186 sched_set_concurrency(kg,
187 thr_concurrency ? thr_concurrency : (2*mp_ncpus));

--- 201 unchanged lines hidden ---
185 }
186
187 if ((td->td_proc->p_flag & P_HADTHREADS) == 0) {
188 /* Treat initial thread as it has PTHREAD_SCOPE_PROCESS. */
189 p->p_procscopegrp = kg;
190 mtx_lock_spin(&sched_lock);
191 sched_set_concurrency(kg,
192 thr_concurrency ? thr_concurrency : (2*mp_ncpus));

--- 201 unchanged lines hidden ---