~ubuntu-branches/ubuntu/trusty/c++-annotations/trusty-proposed

« back to all changes in this revision

Viewing changes to yo/stl/examples/events.cc

  • Committer: Package Import Robot
  • Author(s): Frank B. Brokken
  • Date: 2013-05-30 13:32:18 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20130530133218-k39mr5uredd093jr
Tags: 9.7.2-1
New upstream release, repairs several minor left-over flaws.
This release incorporates 9.7.0 and 9.7.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// g++-4.4 --std=c++0x -pthread events.cc
 
1
// g++ --std=c++0x -pthread events.cc
2
2
 
3
3
#include <mutex>
4
4
#include <condition_variable>
8
8
#include <iostream>
9
9
#include <bobcat/selector>
10
10
#include <bobcat/irandstream>
11
 
#include <bobcat/a2x>
12
11
 
13
12
    class Semaphore
14
13
    {
113
112
            return 1;
114
113
        }
115
114
        cerr << "Go!\n";
116
 
        size_t trials = A2x(argv[1]);
 
115
        size_t trials = stoul(argv[1]);
117
116
 
118
117
        Producer prod(trials);
119
118
        Consumer cons(trials);
123
122
 
124
123
        produce.join();
125
124
        consume.join();
126
 
 
127
 
        return 0;
128
125
    }