kern_thr.c (009e81b16465ea457c0e63fd49fe77f47cc27a5a) | kern_thr.c (2a339d9e3dc129f0b0b79c2cb8d2bb0386fb0f5f) |
---|---|
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 --- 294 unchanged lines hidden (view full) --- 303 return (0); 304} 305 306int 307sys_thr_exit(struct thread *td, struct thr_exit_args *uap) 308 /* long *state */ 309{ 310 | 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 --- 294 unchanged lines hidden (view full) --- 303 return (0); 304} 305 306int 307sys_thr_exit(struct thread *td, struct thr_exit_args *uap) 308 /* long *state */ 309{ 310 |
311 umtx_thread_exit(td); 312 |
|
311 /* Signal userland that it can free the stack. */ 312 if ((void *)uap->state != NULL) { 313 suword_lwpid(uap->state, 1); 314 kern_umtx_wake(td, uap->state, INT_MAX, 0); 315 } 316 317 return (kern_thr_exit(td)); 318} --- 43 unchanged lines hidden (view full) --- 362 * The check above should prevent all other threads from this 363 * process from exiting while the PROC_LOCK is dropped, so 364 * there must be at least one other thread other than the 365 * current thread. 366 */ 367 KASSERT(p->p_numthreads > 1, ("too few threads")); 368 racct_sub(p, RACCT_NTHR, 1); 369 tdsigcleanup(td); | 313 /* Signal userland that it can free the stack. */ 314 if ((void *)uap->state != NULL) { 315 suword_lwpid(uap->state, 1); 316 kern_umtx_wake(td, uap->state, INT_MAX, 0); 317 } 318 319 return (kern_thr_exit(td)); 320} --- 43 unchanged lines hidden (view full) --- 364 * The check above should prevent all other threads from this 365 * process from exiting while the PROC_LOCK is dropped, so 366 * there must be at least one other thread other than the 367 * current thread. 368 */ 369 KASSERT(p->p_numthreads > 1, ("too few threads")); 370 racct_sub(p, RACCT_NTHR, 1); 371 tdsigcleanup(td); |
370 umtx_thread_exit(td); | |
371 PROC_SLOCK(p); 372 thread_stopped(p); 373 thread_exit(); 374 /* NOTREACHED */ 375} 376 377int 378sys_thr_kill(struct thread *td, struct thr_kill_args *uap) --- 232 unchanged lines hidden --- | 372 PROC_SLOCK(p); 373 thread_stopped(p); 374 thread_exit(); 375 /* NOTREACHED */ 376} 377 378int 379sys_thr_kill(struct thread *td, struct thr_kill_args *uap) --- 232 unchanged lines hidden --- |