File: custom_recursive_mutex.cpp

package info (click to toggle)
trompeloeil-cpp 43-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,540 kB
  • sloc: cpp: 15,524; sh: 114; makefile: 17
file content (28 lines) | stat: -rw-r--r-- 506 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define TROMPELOEIL_CUSTOM_RECURSIVE_MUTEX
#include <trompeloeil.hpp>

namespace trompeloeil {

std::unique_ptr<custom_recursive_mutex> create_custom_recursive_mutex() {

  class custom : public custom_recursive_mutex {
    void lock() override { mtx.lock(); }
    void unlock() override { mtx.unlock(); }

  private:
    std::recursive_mutex mtx;
  };

  return std::unique_ptr<custom>(new custom);
}

} // namespace trompeloeil

class C {
public:
  MAKE_MOCK0(func, int(void));
};

int main() {
  C c;
}