source: doc/theses/lynn_tran_SE499/SE499-master/utils.cpp @ 4b75ae9

Last change on this file since 4b75ae9 was 1b34b87, checked in by Peter A. Buhr <pabuhr@…>, 6 years ago

Lynn's GDB essay

  • Property mode set to 100644
File size: 670 bytes
Line 
1#include <string>
2
3_Task T {
4    std::string name;
5    void a(int param) {
6        int x = 3;
7        std::string y = "example";
8        while(1);
9    }
10    void main() {
11        a(5);
12    }
13  public:
14    T( const int tid) {
15        name = "T" + std::to_string(tid);
16        setName( name.c_str() );
17    }
18};
19
20T* global_ptr_S;
21uCluster* global_cluster;
22
23int main() {
24    uProcessor p[3];
25    const int n = 10;
26    T* tasks[n];
27    uCluster fred( "fred"  );
28    global_cluster = &fred;
29
30    for (int i = 0; i < n; i += 1) {
31        tasks[i] = new T(i);
32        global_ptr_S = tasks[1];
33    }
34
35    for (int i = 0; i < n; i += 1) {
36        delete tasks[i];
37    }
38} // main
Note: See TracBrowser for help on using the repository browser.