summaryrefslogtreecommitdiff
path: root/include/media/requestCounter.h
blob: dc8a330986adc571393a3e819d97f7d265b955d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
 * requestCounter.h
 *
 *  Created on: 04.11.2012
 *      Author: savop
 */

#ifndef REQUESTCOUNTER_H_
#define REQUESTCOUNTER_H_

struct request_counter_t {
  // Should be std::atomic<int>. Unfortunatelly, it's supported on C++11 only.
  // Hope, it works anyway.
  static int OPEN_REQUESTS;
  request_counter_t(){++OPEN_REQUESTS;}
  ~request_counter_t(){--OPEN_REQUESTS;}
};

#endif /* REQUESTCOUNTER_H_ */