Changeset de33dab in mainline
- Timestamp:
- 2007-04-09T13:53:57Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 183788f1
- Parents:
- d0b1443
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
rd0b1443 rde33dab 661 661 if (uspace_thread_id != NULL) 662 662 return (unative_t) copy_to_uspace(uspace_thread_id, &t->tid, 663 663 sizeof(t->tid)); 664 664 else 665 665 return 0; -
uspace/libc/arch/sparc64/src/thread_entry.s
rd0b1443 rde33dab 35 35 # 36 36 __thread_entry: 37 sethi %hi(_gp), %l7 37 sethi %hi(_gp), %l7 38 38 call __thread_main ! %o0 contains address of uarg 39 39 or %l7, %lo(_gp), %l7 -
uspace/libc/generic/io/printf_core.c
rd0b1443 rde33dab 41 41 #include <ctype.h> 42 42 #include <string.h> 43 #include <async.h> /* for pseudo thread serialization */ 43 44 44 45 #define __PRINTF_FLAG_PREFIX 0x00000001 /**< show prefixes 0x or 0*/ … … 443 444 int width, precision; 444 445 uint64_t flags; 446 447 /* Don't let other pseudo threads interfere. */ 448 async_serialize_start(); 445 449 446 450 counter = 0; … … 675 679 } 676 680 681 async_serialize_end(); 677 682 return counter; 678 683 minus_out: 684 async_serialize_end(); 679 685 return -counter; 680 686 } -
uspace/libc/generic/io/vprintf.c
rd0b1443 rde33dab 37 37 #include <unistd.h> 38 38 #include <io/printf_core.h> 39 #include <futex.h>40 41 atomic_t printf_futex = FUTEX_INITIALIZER;42 39 43 40 static int vprintf_write(const char *str, size_t count, void *unused) … … 55 52 struct printf_spec ps = {(int(*)(void *, size_t, void *)) vprintf_write, NULL}; 56 53 57 futex_down(&printf_futex);58 54 int ret = printf_core(fmt, &ps, ap); 59 futex_up(&printf_futex);60 55 61 56 return ret; -
uspace/tester/fault/fault1.c
rd0b1443 rde33dab 34 34 ((int *)(0))[1] = 0; 35 35 36 return " Writtento NULL";36 return "Survived write to NULL"; 37 37 } -
uspace/tester/fault/fault2.c
rd0b1443 rde33dab 37 37 var1 = *((int *) (((char *) (&var)) + 1)); 38 38 39 return " Doneunaligned read";39 return "Survived unaligned read"; 40 40 } -
uspace/tester/thread/thread1.c
rd0b1443 rde33dab 34 34 #include <stdio.h> 35 35 #include <unistd.h> 36 #include <futex.h> 36 37 #include "../tester.h" 37 38 … … 40 41 static bool sh_quiet; 41 42 43 static atomic_t srlz = FUTEX_INITIALIZER; 44 42 45 static void threadtest(void *data) 43 46 { … … 45 48 46 49 while (atomic_get(&finish)) { 47 if (!sh_quiet) 50 if (!sh_quiet) { 51 futex_down(&srlz); 48 52 printf("%llu ", thread_get_id()); 53 futex_up(&srlz); 54 } 49 55 usleep(100000); 50 56 } … … 69 75 } 70 76 71 if (!quiet) 77 if (!quiet) { 78 futex_down(&srlz); 72 79 printf("Running threads for 10 seconds...\n"); 80 futex_up(&srlz); 81 } 73 82 sleep(10); 74 83
Note:
See TracChangeset
for help on using the changeset viewer.