Changeset 2a46e10 in mainline for test/mm/slab2/test.c
- Timestamp:
- 2006-02-16T13:35:02Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3debedec
- Parents:
- ff4e1cd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mm/slab2/test.c
rff4e1cd r2a46e10 35 35 #include <mm/frame.h> 36 36 #include <memstr.h> 37 #include <synch/condvar.h> 38 #include <synch/mutex.h> 37 39 38 40 #define ITEM_SIZE 256 … … 116 118 slab_cache_t *thr_cache; 117 119 semaphore_t thr_sem; 120 condvar_t thread_starter; 121 mutex_t starter_mutex; 118 122 119 123 #define THREADS 8 … … 123 127 void *data=NULL, *new; 124 128 129 mutex_lock(&starter_mutex); 130 condvar_wait(&thread_starter,&starter_mutex); 131 mutex_unlock(&starter_mutex); 132 125 133 printf("Starting thread #%d...\n",THREAD->tid); 126 134 … … 173 181 174 182 printf("Running stress test with size %d\n", size); 183 condvar_initialize(&thread_starter); 184 mutex_initialize(&starter_mutex); 185 175 186 thr_cache = slab_cache_create("thread_cache", size, 0, 176 187 NULL, NULL, … … 182 193 thread_ready(t); 183 194 } 195 thread_sleep(1); 196 condvar_broadcast(&thread_starter); 184 197 185 198 for (i=0; i<THREADS; i++)
Note:
See TracChangeset
for help on using the changeset viewer.