Main Page | Class Hierarchy | Class List | File List | Class Members

ab-example.cc

00001 #include "mtasker.hh"
00002 #include <iostream>
00003 
00004 using namespace std;
00005 
00006 MTasker<> MT;
00007 
00008 void printer(void *p)
00009 {
00010   char c=(char)p;
00011   for(;;) {
00012     cout<<c<<endl;
00013     MT.yield();
00014   }
00015 
00016 }
00017 
00018 
00019 int main()
00020 {
00021   MT.makeThread(printer,(void*)'a');
00022   MT.makeThread(printer,(void*)'b');
00023 
00024   for(;;) {
00025     while(MT.schedule()); // do everything we can do
00026   }
00027 }

Generated on Sun Feb 8 12:07:52 2004 for MTasker by doxygen 1.3.5