X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=direct%2Ftimothy_tests%2Fthreading%2Fthreading.c;h=96a91f8da16684b765287c456b8d22d95ad9e88c;hp=a9ed1bb577caddc61831af9e5da1fcecfce78cd0;hb=6648cbf52d6695755941ff8607fd7a0cda542e05;hpb=5f61aa469fb4b46a5a1f4aacbe459323b5d13edd diff --git a/direct/timothy_tests/threading/threading.c b/direct/timothy_tests/threading/threading.c index a9ed1bb..96a91f8 100644 --- a/direct/timothy_tests/threading/threading.c +++ b/direct/timothy_tests/threading/threading.c @@ -1,7 +1,7 @@ /* * YAFFS: Yet another FFS. A NAND-flash specific file system. * - * Copyright (C) 2002-2010 Aleph One Ltd. + * Copyright (C) 2002-2011 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Timothy Manning @@ -21,7 +21,7 @@ const struct option long_options[]={ {"threads", 1,NULL,'t'} }; -const char short_options[]="hqn:t:cv"; +const char short_options[]="ht:"; @@ -31,16 +31,15 @@ void main_init(int argc, char *argv[]) int new_option; int x=0; int new_num_of_threads=5; + x=(unsigned)time(NULL); + printf("seeding srand with: %d\n",x); + srand(x); do{ new_option=getopt_long(argc,argv,short_options,long_options,NULL); - if (0==strcmp(argv[x],"-h")){ + if (new_option=='h'){ printf("help\n"); printf("-h will print the commands available\n"); - printf("-c will continue after a test failes else the program will exit\n"); - printf("-v will print all messages\n"); - printf("-q quiet mode only the number of tests passed and failed will be printed\n"); - printf("-t [number] set yaffs_trace to number\n"); - printf("-n [number] sets the number of random loops to run after the the test has run\n"); + printf("-t [number] sets the number of threads\n"); exit(0); } else if (new_option=='t') { new_num_of_threads=atoi(optarg); @@ -75,6 +74,7 @@ int main(int argc, char *argv[]) printf("| %d ",get_counter(y)); } printf("\n"); + sleep(1); } }