Changeset deada67 in mainline for kernel/test/synch/rwlock2.c
- Timestamp:
- 2006-12-19T17:54:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 730376d
- Parents:
- 6536a4a9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/test/synch/rwlock2.c
r6536a4a9 rdeada67 39 39 40 40 static rwlock_t rwlock; 41 static bool sh_quiet; 41 42 42 43 static void writer(void *arg) 43 44 { 44 45 thread_detach(THREAD); 46 47 printf("Trying to lock rwlock for writing....\n"); 48 45 if (!sh_quiet) 46 printf("Trying to lock rwlock for writing....\n"); 47 49 48 rwlock_write_lock(&rwlock); 50 49 rwlock_write_unlock(&rwlock); 51 50 52 printf("Trying to lock rwlock for reading....\n"); 51 if (!sh_quiet) 52 printf("Trying to lock rwlock for reading....\n"); 53 53 54 rwlock_read_lock(&rwlock); 54 55 rwlock_read_unlock(&rwlock); 55 printf("Test passed.\n");56 56 } 57 57 … … 59 59 { 60 60 thread_t *thrd; 61 sh_quiet = quiet; 61 62 62 63 rwlock_initialize(&rwlock); … … 80 81 rwlock_read_unlock(&rwlock); 81 82 83 thread_join(thrd); 84 thread_detach(thrd); 85 82 86 return NULL; 83 87 }
Note:
See TracChangeset
for help on using the changeset viewer.