/kernel/trunk/test/synch/rwlock2/test.c |
---|
74,7 → 74,7 |
rwlock_read_lock(&rwlock); |
rwlock_read_lock(&rwlock); |
thrd = thread_create(writer, NULL, TASK, 0); |
thrd = thread_create(writer, NULL, TASK, 0, "writer"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/synch/rwlock3/test.c |
---|
77,7 → 77,7 |
rwlock_write_lock(&rwlock); |
for (i=0; i<4; i++) { |
thrd = thread_create(reader, NULL, TASK, 0); |
thrd = thread_create(reader, NULL, TASK, 0, "reader"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/synch/semaphore1/test.c |
---|
99,7 → 99,7 |
for (j=0; j<(CONSUMERS+PRODUCERS)/2; j++) { |
for (k=0; k<i; k++) { |
thrd = thread_create(consumer, NULL, TASK, 0); |
thrd = thread_create(consumer, NULL, TASK, 0, "consumer"); |
if (thrd) |
thread_ready(thrd); |
else |
106,7 → 106,7 |
failed(); |
} |
for (k=0; k<(4-i); k++) { |
thrd = thread_create(producer, NULL, TASK, 0); |
thrd = thread_create(producer, NULL, TASK, 0, "producer"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/synch/rwlock4/test.c |
---|
137,7 → 137,7 |
k = random(7) + 1; |
printf("Creating %d readers\n", k); |
for (i=0; i<k; i++) { |
thrd = thread_create(reader, NULL, TASK, 0); |
thrd = thread_create(reader, NULL, TASK, 0, "reader"); |
if (thrd) |
thread_ready(thrd); |
else |
147,7 → 147,7 |
k = random(5) + 1; |
printf("Creating %d writers\n", k); |
for (i=0; i<k; i++) { |
thrd = thread_create(writer, NULL, TASK, 0); |
thrd = thread_create(writer, NULL, TASK, 0, "writer"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/synch/semaphore2/test.c |
---|
107,7 → 107,7 |
k = random(7) + 1; |
printf("Creating %d consumers\n", k); |
for (i=0; i<k; i++) { |
thrd = thread_create(consumer, NULL, TASK, 0); |
thrd = thread_create(consumer, NULL, TASK, 0, "consumer"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/synch/rwlock5/test.c |
---|
95,7 → 95,7 |
for (j=0; j<(READERS+WRITERS)/2; j++) { |
for (k=0; k<i; k++) { |
thrd = thread_create(reader, NULL, TASK, 0); |
thrd = thread_create(reader, NULL, TASK, 0, "reader"); |
if (thrd) |
thread_ready(thrd); |
else |
102,7 → 102,7 |
failed(); |
} |
for (k=0; k<(4-i); k++) { |
thrd = thread_create(writer, NULL, TASK, 0); |
thrd = thread_create(writer, NULL, TASK, 0, "writer"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/thread/thread1/test.c |
---|
39,7 → 39,7 |
#define THREADS 5 |
static void thread(void *data) |
static void threadtest(void *data) |
{ |
while(1) |
{ |
54,7 → 54,7 |
int i; |
for (i=0; i<THREADS; i++) { |
if (!(t = thread_create(thread, NULL, TASK, 0))) |
if (!(t = thread_create(threadtest, NULL, TASK, 0, "threadtest"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |
/kernel/trunk/test/mm/falloc2/test.c |
---|
44,12 → 44,12 |
#define THREAD_RUNS 1 |
#define THREADS 8 |
static void thread(void * arg); |
static void falloc(void * arg); |
static void failed(void); |
static atomic_t thread_count; |
void thread(void * arg) |
void falloc(void * arg) |
{ |
int status, order, run, allocated, i; |
__u8 val = THREAD->tid % THREADS; |
107,7 → 107,7 |
for (i = 0; i < THREADS; i++) { |
thread_t * thrd; |
thrd = thread_create(thread, NULL, TASK, 0); |
thrd = thread_create(falloc, NULL, TASK, 0, "falloc"); |
if (thrd) |
thread_ready(thrd); |
else |
/kernel/trunk/test/mm/slab1/test.c |
---|
108,7 → 108,7 |
slab_cache_t *thr_cache; |
semaphore_t thr_sem; |
static void thread(void *data) |
static void slabtest(void *data) |
{ |
int offs = (int)(__native) data; |
int i,j; |
138,7 → 138,7 |
SLAB_CACHE_NOMAGAZINE); |
semaphore_initialize(&thr_sem,0); |
for (i=0; i<THREADS; i++) { |
if (!(t = thread_create(thread, (void *)(__native)i, TASK, 0))) |
if (!(t = thread_create(slabtest, (void *)(__native)i, TASK, 0, "slabtest"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |
/kernel/trunk/test/mm/slab2/test.c |
---|
122,7 → 122,7 |
#define THREADS 8 |
static void thread(void *priv) |
static void slabtest(void *priv) |
{ |
void *data=NULL, *new; |
188,7 → 188,7 |
0); |
semaphore_initialize(&thr_sem,0); |
for (i=0; i<THREADS; i++) { |
if (!(t = thread_create(thread, NULL, TASK, 0))) |
if (!(t = thread_create(slabtest, NULL, TASK, 0, "slabtest"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |
/kernel/trunk/test/fpu/mips1/test.c |
---|
112,10 → 112,10 |
printf("Creating %d threads... ", THREADS); |
for (i=0; i<THREADS/2; i++) { |
if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0))) |
if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1"))) |
panic("could not create thread\n"); |
thread_ready(t); |
if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0))) |
if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |
/kernel/trunk/test/fpu/fpu1/test.c |
---|
143,7 → 143,6 |
atomic_inc(&threads_ok); |
} |
void test(void) |
{ |
thread_t *t; |
155,10 → 154,10 |
printf("Creating %d threads... ", THREADS); |
for (i=0; i<THREADS/2; i++) { |
if (!(t = thread_create(e, NULL, TASK, 0))) |
if (!(t = thread_create(e, NULL, TASK, 0, "e"))) |
panic("could not create thread\n"); |
thread_ready(t); |
if (!(t = thread_create(pi, NULL, TASK, 0))) |
if (!(t = thread_create(pi, NULL, TASK, 0, "pi"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |
172,43 → 171,3 |
printf("Test passed.\n"); |
} |
/* |
static void pi(void *data) |
{ |
#undef PI_10e8 |
#define PI_10e8 3141592 |
int i; |
double lpi, pi; |
double n, ab, ad; |
printf("pi test\n"); |
waitq_sleep(&can_start); |
for (i = 0; i<ATTEMPTS; i++) { |
lpi = -1; |
pi = 0; |
for (n=2, ab = sqrt(2); lpi != pi; n *= 2, ab = ad) { |
double sc, cd; |
sc = sqrt(1 - (ab*ab/4)); |
cd = 1 - sc; |
ad = sqrt(ab*ab/4 + cd*cd); |
lpi = pi; |
pi = 2 * n * ad; |
} |
atomic_inc(&threads_ok); |
if((int)(1000000*pi)!=PI_10e8) |
panic("tid%d: pi*10e6=%d\n", THREAD->tid, (int) 1000000*pi); |
} |
printf("tid%d: pi*10e6=%d\n", THREAD->tid, (int) 1000000*pi); |
} |
*/ |
/kernel/trunk/test/fpu/sse1/test.c |
---|
112,10 → 112,10 |
printf("Creating %d threads... ", THREADS); |
for (i=0; i<THREADS/2; i++) { |
if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0))) |
if (!(t = thread_create(testit1, (void *)((__native)i*2), TASK, 0, "testit1"))) |
panic("could not create thread\n"); |
thread_ready(t); |
if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0))) |
if (!(t = thread_create(testit2, (void *)((__native)i*2+1), TASK, 0, "testit2"))) |
panic("could not create thread\n"); |
thread_ready(t); |
} |