Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 2 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 3 | #include <exports.h> |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 4 | |
| 5 | /* |
| 6 | * Author: Arun Dharankar <ADharankar@ATTBI.Com> |
| 7 | * |
| 8 | * A very simple thread/schedular model: |
| 9 | * - only one master thread, and no parent child relation maintained |
| 10 | * - parent thread cannot be stopped or deleted |
| 11 | * - no permissions or credentials |
| 12 | * - no elaborate safety checks |
| 13 | * - cooperative multi threading |
| 14 | * - Simple round-robin scheduleing with no priorities |
| 15 | * - no metering/statistics collection |
| 16 | * |
| 17 | * Basic idea of implementing this is to allow more than one tests to |
| 18 | * execute "simultaneously". |
| 19 | * |
| 20 | * This may be modified such thread_yield may be called in syscalls, and |
| 21 | * timer interrupts. |
| 22 | */ |
| 23 | |
| 24 | |
| 25 | #define MAX_THREADS 8 |
| 26 | |
| 27 | #define CTX_SIZE 512 |
| 28 | #define STK_SIZE 8*1024 |
| 29 | |
| 30 | #define STATE_EMPTY 0 |
| 31 | #define STATE_RUNNABLE 1 |
| 32 | #define STATE_STOPPED 2 |
| 33 | #define STATE_TERMINATED 2 |
| 34 | |
| 35 | #define MASTER_THREAD 0 |
| 36 | |
| 37 | #define RC_FAILURE (-1) |
| 38 | #define RC_SUCCESS (0) |
| 39 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 40 | typedef vu_char *jmp_ctx; |
| 41 | unsigned long setctxsp (vu_char *sp); |
| 42 | int ppc_setjmp(jmp_ctx env); |
| 43 | void ppc_longjmp(jmp_ctx env, int val); |
| 44 | #define setjmp ppc_setjmp |
| 45 | #define longjmp ppc_longjmp |
| 46 | |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 47 | struct lthread { |
| 48 | int state; |
| 49 | int retval; |
| 50 | char stack[STK_SIZE]; |
| 51 | uchar context[CTX_SIZE]; |
| 52 | int (*func) (void *); |
| 53 | void *arg; |
| 54 | }; |
| 55 | static volatile struct lthread lthreads[MAX_THREADS]; |
| 56 | static volatile int current_tid = MASTER_THREAD; |
| 57 | |
| 58 | |
| 59 | static uchar dbg = 0; |
| 60 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 61 | #define PDEBUG(fmt, args...) { \ |
| 62 | if(dbg != 0) { \ |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 63 | printf("[%s %d %s]: ",__FILE__,__LINE__,__FUNCTION__);\ |
| 64 | printf(fmt, ##args); \ |
| 65 | printf("\n"); \ |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 66 | } \ |
| 67 | } |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 68 | |
| 69 | static int testthread (void *); |
| 70 | static void sched_init (void); |
| 71 | static int thread_create (int (*func) (void *), void *arg); |
| 72 | static int thread_start (int id); |
| 73 | static void thread_yield (void); |
| 74 | static int thread_delete (int id); |
| 75 | static int thread_join (int *ret); |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 76 | |
| 77 | #if 0 /* not used yet */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 78 | static int thread_stop (int id); |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 79 | #endif /* not used yet */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 80 | |
| 81 | /* An example of schedular test */ |
| 82 | |
| 83 | #define NUMTHREADS 7 |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 84 | int sched (int ac, char *av[]) |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 85 | { |
| 86 | int i, j; |
| 87 | int tid[NUMTHREADS]; |
| 88 | int names[NUMTHREADS]; |
| 89 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 90 | app_startup(av); |
| 91 | |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 92 | sched_init (); |
| 93 | |
| 94 | for (i = 0; i < NUMTHREADS; i++) { |
| 95 | names[i] = i; |
| 96 | j = thread_create (testthread, (void *) &names[i]); |
| 97 | if (j == RC_FAILURE) |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 98 | printf ("schedtest: Failed to create thread %d\n", i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 99 | if (j > 0) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 100 | printf ("schedtest: Created thread with id %d, name %d\n", |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 101 | j, i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 102 | tid[i] = j; |
| 103 | } |
| 104 | } |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 105 | printf ("schedtest: Threads created\n"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 106 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 107 | printf ("sched_test: function=0x%08x\n", (unsigned)testthread); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 108 | for (i = 0; i < NUMTHREADS; i++) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 109 | printf ("schedtest: Setting thread %d runnable\n", tid[i]); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 110 | thread_start (tid[i]); |
| 111 | thread_yield (); |
| 112 | } |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 113 | printf ("schedtest: Started %d threads\n", NUMTHREADS); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 114 | |
| 115 | while (1) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 116 | printf ("schedtest: Waiting for threads to complete\n"); |
| 117 | if (tstc () && getc () == 0x3) { |
| 118 | printf ("schedtest: Aborting threads...\n"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 119 | for (i = 0; i < NUMTHREADS; i++) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 120 | printf ("schedtest: Deleting thread %d\n", tid[i]); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 121 | thread_delete (tid[i]); |
| 122 | } |
| 123 | return RC_SUCCESS; |
| 124 | } |
| 125 | j = -1; |
| 126 | i = thread_join (&j); |
| 127 | if (i == RC_FAILURE) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 128 | printf ("schedtest: No threads pending, " |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 129 | "exiting schedular test\n"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 130 | return RC_SUCCESS; |
| 131 | } |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 132 | printf ("schedtest: thread is %d returned %d\n", i, j); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 133 | thread_yield (); |
| 134 | } |
| 135 | |
| 136 | return RC_SUCCESS; |
| 137 | } |
| 138 | |
| 139 | static int testthread (void *name) |
| 140 | { |
| 141 | int i; |
| 142 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 143 | printf ("testthread: Begin executing thread, myname %d, &i=0x%08x\n", |
| 144 | *(int *) name, (unsigned)&i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 145 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 146 | printf ("Thread %02d, i=%d\n", *(int *) name, i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 147 | |
| 148 | for (i = 0; i < 0xffff * (*(int *) name + 1); i++) { |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 149 | if (tstc () && getc () == 0x3) { |
| 150 | printf ("testthread: myname %d terminating.\n", |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 151 | *(int *) name); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 152 | return *(int *) name + 1; |
| 153 | } |
| 154 | |
| 155 | if (i % 100 == 0) |
| 156 | thread_yield (); |
| 157 | } |
| 158 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 159 | printf ("testthread: returning %d, i=0x%x\n", |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 160 | *(int *) name + 1, i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 161 | |
| 162 | return *(int *) name + 1; |
| 163 | } |
| 164 | |
| 165 | |
| 166 | static void sched_init (void) |
| 167 | { |
| 168 | int i; |
| 169 | |
| 170 | for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) |
| 171 | lthreads[i].state = STATE_EMPTY; |
| 172 | |
| 173 | current_tid = MASTER_THREAD; |
| 174 | lthreads[current_tid].state = STATE_RUNNABLE; |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 175 | PDEBUG ("sched_init: master context = 0x%08x", |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 176 | (unsigned)lthreads[current_tid].context); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 177 | return; |
| 178 | } |
| 179 | |
| 180 | static void thread_yield (void) |
| 181 | { |
| 182 | static int i; |
| 183 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 184 | PDEBUG ("thread_yield: current tid=%d", current_tid); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 185 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 186 | #define SWITCH(new) \ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 187 | if(lthreads[new].state == STATE_RUNNABLE) { \ |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 188 | PDEBUG("thread_yield: %d match, ctx=0x%08x", \ |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 189 | new, \ |
| 190 | (unsigned)lthreads[current_tid].context); \ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 191 | if(setjmp(lthreads[current_tid].context) == 0) { \ |
| 192 | current_tid = new; \ |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 193 | PDEBUG("thread_yield: tid %d returns 0", \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 194 | new); \ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 195 | longjmp(lthreads[new].context, 1); \ |
| 196 | } else { \ |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 197 | PDEBUG("thread_yield: tid %d returns 1", \ |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 198 | new); \ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 199 | return; \ |
| 200 | } \ |
| 201 | } |
| 202 | |
| 203 | for (i = current_tid + 1; i < MAX_THREADS; i++) { |
| 204 | SWITCH (i); |
| 205 | } |
| 206 | |
| 207 | if (current_tid != 0) { |
| 208 | for (i = 0; i <= current_tid; i++) { |
| 209 | SWITCH (i); |
| 210 | } |
| 211 | } |
| 212 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 213 | PDEBUG ("thread_yield: returning from thread_yield"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 214 | return; |
| 215 | } |
| 216 | |
| 217 | static int thread_create (int (*func) (void *), void *arg) |
| 218 | { |
| 219 | int i; |
| 220 | |
| 221 | for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) { |
| 222 | if (lthreads[i].state == STATE_EMPTY) { |
| 223 | lthreads[i].state = STATE_STOPPED; |
| 224 | lthreads[i].func = func; |
| 225 | lthreads[i].arg = arg; |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 226 | PDEBUG ("thread_create: returns new tid %d", i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 227 | return i; |
| 228 | } |
| 229 | } |
| 230 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 231 | PDEBUG ("thread_create: returns failure"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 232 | return RC_FAILURE; |
| 233 | } |
| 234 | |
| 235 | static int thread_delete (int id) |
| 236 | { |
| 237 | if (id <= MASTER_THREAD || id > MAX_THREADS) |
| 238 | return RC_FAILURE; |
| 239 | |
| 240 | if (current_tid == id) |
| 241 | return RC_FAILURE; |
| 242 | |
| 243 | lthreads[id].state = STATE_EMPTY; |
| 244 | return RC_SUCCESS; |
| 245 | } |
| 246 | |
| 247 | static void thread_launcher (void) |
| 248 | { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 249 | PDEBUG ("thread_launcher: invoking func=0x%08x", |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 250 | (unsigned)lthreads[current_tid].func); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 251 | |
| 252 | lthreads[current_tid].retval = |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 253 | lthreads[current_tid].func (lthreads[current_tid].arg); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 254 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 255 | PDEBUG ("thread_launcher: tid %d terminated", current_tid); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 256 | |
| 257 | lthreads[current_tid].state = STATE_TERMINATED; |
| 258 | thread_yield (); |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 259 | printf ("thread_launcher: should NEVER get here!\n"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 260 | |
| 261 | return; |
| 262 | } |
| 263 | |
| 264 | static int thread_start (int id) |
| 265 | { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 266 | PDEBUG ("thread_start: id=%d", id); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 267 | if (id <= MASTER_THREAD || id > MAX_THREADS) { |
| 268 | return RC_FAILURE; |
| 269 | } |
| 270 | |
| 271 | if (lthreads[id].state != STATE_STOPPED) |
| 272 | return RC_FAILURE; |
| 273 | |
| 274 | if (setjmp (lthreads[current_tid].context) == 0) { |
| 275 | lthreads[id].state = STATE_RUNNABLE; |
| 276 | current_tid = id; |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 277 | PDEBUG ("thread_start: to be stack=0%08x", |
| 278 | (unsigned)lthreads[id].stack); |
Wolfgang Denk | 7fb5266 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 279 | setctxsp ((vu_char *)<hreads[id].stack[STK_SIZE]); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 280 | thread_launcher (); |
| 281 | } |
| 282 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 283 | PDEBUG ("thread_start: Thread id=%d started, parent returns", id); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 284 | |
| 285 | return RC_SUCCESS; |
| 286 | } |
| 287 | |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 288 | #if 0 /* not used so far */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 289 | static int thread_stop (int id) |
| 290 | { |
| 291 | if (id <= MASTER_THREAD || id >= MAX_THREADS) |
| 292 | return RC_FAILURE; |
| 293 | |
| 294 | if (current_tid == id) |
| 295 | return RC_FAILURE; |
| 296 | |
| 297 | lthreads[id].state = STATE_STOPPED; |
| 298 | return RC_SUCCESS; |
| 299 | } |
wdenk | 874ac26 | 2003-07-24 23:38:38 +0000 | [diff] [blame] | 300 | #endif /* not used so far */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 301 | |
| 302 | static int thread_join (int *ret) |
| 303 | { |
| 304 | int i, j = 0; |
| 305 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 306 | PDEBUG ("thread_join: *ret = %d", *ret); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 307 | |
| 308 | if (!(*ret == -1 || *ret > MASTER_THREAD || *ret < MAX_THREADS)) { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 309 | PDEBUG ("thread_join: invalid tid %d", *ret); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 310 | return RC_FAILURE; |
| 311 | } |
| 312 | |
| 313 | if (*ret == -1) { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 314 | PDEBUG ("Checking for tid = -1"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 315 | while (1) { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 316 | /* PDEBUG("thread_join: start while-loopn"); */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 317 | j = 0; |
| 318 | for (i = MASTER_THREAD + 1; i < MAX_THREADS; i++) { |
| 319 | if (lthreads[i].state == STATE_TERMINATED) { |
| 320 | *ret = lthreads[i].retval; |
| 321 | lthreads[i].state = STATE_EMPTY; |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 322 | /* PDEBUG("thread_join: returning retval %d of tid %d", |
| 323 | ret, i); */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 324 | return RC_SUCCESS; |
| 325 | } |
| 326 | |
| 327 | if (lthreads[i].state != STATE_EMPTY) { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 328 | PDEBUG ("thread_join: %d used slots tid %d state=%d", |
| 329 | j, i, lthreads[i].state); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 330 | j++; |
| 331 | } |
| 332 | } |
| 333 | if (j == 0) { |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 334 | PDEBUG ("thread_join: all slots empty!"); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 335 | return RC_FAILURE; |
| 336 | } |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 337 | /* PDEBUG("thread_join: yielding"); */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 338 | thread_yield (); |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 339 | /* PDEBUG("thread_join: back from yield"); */ |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 340 | } |
| 341 | } |
| 342 | |
| 343 | if (lthreads[*ret].state == STATE_TERMINATED) { |
| 344 | i = *ret; |
| 345 | *ret = lthreads[*ret].retval; |
| 346 | lthreads[*ret].state = STATE_EMPTY; |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 347 | PDEBUG ("thread_join: returing %d for tid %d", *ret, i); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 348 | return RC_SUCCESS; |
| 349 | } |
| 350 | |
wdenk | b02744a | 2003-04-05 00:53:31 +0000 | [diff] [blame] | 351 | PDEBUG ("thread_join: thread %d is not terminated!", *ret); |
wdenk | 8dba050 | 2003-03-31 16:34:49 +0000 | [diff] [blame] | 352 | return RC_FAILURE; |
| 353 | } |