Changeset 29a9f62 in mainline for init/init.c
- Timestamp:
- 2006-03-23T10:33:55Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 77bd004
- Parents:
- 1cef26f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
r1cef26f r29a9f62 34 34 #include <ns.h> 35 35 #include <thread.h> 36 #include <psthread.h> 36 37 #include <futex.h> 37 38 … … 253 254 } 254 255 255 256 static int ptest(void *arg) 257 { 258 printf("Pseudo thread-1\n"); 259 ps_preempt(); 260 printf("Pseudo thread-2\n"); 261 ps_preempt(); 262 printf("Pseudo thread-3\n"); 263 ps_preempt(); 264 printf("Pseudo thread-4\n"); 265 ps_preempt(); 266 printf("Pseudo finish\n"); 267 return 0; 268 } 256 269 257 270 int main(int argc, char *argv[]) 258 271 { 272 pstid_t ptid; 259 273 int tid; 274 260 275 version_print(); 261 276 … … 274 289 printf("Futex failed.\n"); 275 290 291 if ((tid = thread_create(utest, NULL, "utest") != -1)) { 292 printf("Created thread tid=%d\n", tid); 293 } 294 276 295 if (futex_down(&ftx) < 0) 277 296 printf("Futex failed.\n"); … … 289 308 printf("Futex failed.\n"); 290 309 310 ptid = psthread_create(ptest, NULL); 311 printf("Main thread-1\n"); 312 ps_preempt(); 313 printf("Main thread-2\n"); 314 ps_preempt(); 315 printf("main thread-3\n"); 316 317 ps_join(ptid); 318 printf("Main exiting\n"); 319 291 320 printf("Main thread exiting.\n"); 292 321 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.