Beispiel #1
0
/* ARGSUSED */
static void
io_init_done(cnodeid_t cnodeid,cpu_cookie_t c)
{
	/* Let boot processor know that we're done. */
#ifdef LINUX_KERNEL_THREADS
	up(&io_init_sema);
#endif
#ifdef LATER
	/* This is for the setnoderun done when the io_init thread
	 * started 
	 */
	restorenoderun(c);
	sthread_exit();
#endif
}
Beispiel #2
0
/* read/write 100 blocks, randomly distributed */
void tester(int n)
{
    int i, blocknum;
    char block[BLOCKSIZE];

    for (i = 0; i < NTESTS; i++) {
        blocknum = randomblock();
        if (rand() % 2) {	/* if odd, simulate a write */
            *(int *)block = n * NBLOCKS + blocknum;
            writeblock(block, blocknum); /* write the new value */
            printf("Wrote block %2d in thread %d: %3d\n", blocknum, n, *(int *)block);
        }
        else {		/* if even, simulate a read */
            readblock(block, blocknum);
            printf("Read  block %2d in thread %d: %3d\n", blocknum, n, *(int *)block);
        }
    }
    sthread_exit(100 + n);
    // Not reached
}
void go(int n)
{
  printf("Hello from thread %d\n", n);
  sthread_exit(100 + n);
  // Not reached
}