kern_thread.c (de028f5a4a67b635ea3e45799be822c8daa1ff20) | kern_thread.c (b19d9defef17fd447813157b9e7fd8ad26a78cb2) |
---|---|
1/* 2 * Copyright (C) 2001 Julian Elischer <julian@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 --- 101 unchanged lines hidden (view full) --- 110/* 111 * Reclaim a thread after use. 112 */ 113static void 114thread_dtor(void *mem, int size, void *arg) 115{ 116 struct thread *td; 117 | 1/* 2 * Copyright (C) 2001 Julian Elischer <julian@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 --- 101 unchanged lines hidden (view full) --- 110/* 111 * Reclaim a thread after use. 112 */ 113static void 114thread_dtor(void *mem, int size, void *arg) 115{ 116 struct thread *td; 117 |
118 mtx_assert(&Giant, MA_OWNED); |
|
118 td = (struct thread *)mem; 119 120#ifdef INVARIANTS 121 /* Verify that this thread is in a safe state to free. */ 122 switch (td->td_state) { 123 case TDS_INHIBITED: 124 case TDS_RUNNING: 125 case TDS_CAN_RUN: --- 6 unchanged lines hidden (view full) --- 132 /* NOTREACHED */ 133 case TDS_INACTIVE: 134 break; 135 default: 136 panic("bad thread state"); 137 /* NOTREACHED */ 138 } 139#endif | 119 td = (struct thread *)mem; 120 121#ifdef INVARIANTS 122 /* Verify that this thread is in a safe state to free. */ 123 switch (td->td_state) { 124 case TDS_INHIBITED: 125 case TDS_RUNNING: 126 case TDS_CAN_RUN: --- 6 unchanged lines hidden (view full) --- 133 /* NOTREACHED */ 134 case TDS_INACTIVE: 135 break; 136 default: 137 panic("bad thread state"); 138 /* NOTREACHED */ 139 } 140#endif |
141 142 cpu_thread_dtor(td); |
|
140} 141 142/* 143 * Initialize type-stable parts of a thread (when newly created). 144 */ 145static void 146thread_init(void *mem, int size) 147{ --- 1747 unchanged lines hidden --- | 143} 144 145/* 146 * Initialize type-stable parts of a thread (when newly created). 147 */ 148static void 149thread_init(void *mem, int size) 150{ --- 1747 unchanged lines hidden --- |