- added new task for pi0 reconstruction using purely calorimeter clusters
[u/mrichter/AliRoot.git] / STORAGE / alistorage_main / alistorage_main.cxx
1 #include "AliStorageClientThread.h"
2 #include "AliStorageServerThread.h"
3
4 #include <iostream>
5
6 using namespace std;
7
8 void *ClientThreadHandle(void*)
9 {
10         cout<<"ALICE Storage Manager -- Starting client thread"<<endl;
11         AliStorageClientThread *client = new AliStorageClientThread();
12
13         if(client)
14         {
15                 client->CollectData();
16         }
17         else
18         {
19                 cout<<"ALICE Storage Manager -- ERROR - failed to start client thread!!"<<endl;
20         }
21         
22         if(client){delete client;}
23         return 0;
24 }
25
26 void *ServerThreadHandle(void*)
27 {
28         cout<<"\nALICE Storage Manager -- Starting server thread"<<endl;
29         AliStorageServerThread *server = new AliStorageServerThread();
30
31         if(!server)
32         {
33                 cout<<"ALICE Storage Manager -- ERROR - failed to start server thread!!"<<endl;
34         }
35         if(server){delete server;}
36         return 0;
37 }
38
39 int main()
40 {
41         TThread *clientThread = new TThread("clientThread", ClientThreadHandle,NULL);
42         
43         TThread *serverThread = new TThread("serverThread", ServerThreadHandle,NULL);
44         clientThread->Run();
45         serverThread->Run();
46         
47         clientThread->Join();
48         serverThread->Kill();//if client thread if finished, server thread is killed    
49         return 0;
50 }