Subversion Repositories programming

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
321 ira 1
#include <cstdio>
2
#include <unistd.h>
3
using namespace std;
4
 
5
#include <boost/thread/thread.hpp>
6
#include <boost/bind.hpp>
7
 
8
#include "controller.h"
9
#include "elevator.h"
10
 
11
int main (int argc, char *argv[])
12
{
13
    int i = 0;
14
    Elevator e1 (10);
15
    Controller c (10, 5);
16
 
17
    vector<Elevator> elevators (5, Elevator (10));
18
 
19
    // start t1
20
    boost::thread t1 (boost::bind (e1.thread_entry, &e1));
21
 
328 ira 22
    // do some useful stuff here
321 ira 23
 
24
    // notify t1 that it needs to stop
25
    e1.thread_exit ();
26
 
27
    // wait for t1 to stop
28
    t1.join ();
29
 
30
    return 0;
31
}
32