blob: e4487d4c6f5c80e5cf97ce99e2ef17bedf39f0f9 [file] [log] [blame]
bartf68af882011-12-10 19:42:05 +00001// Test whether no race conditions are reported on std::thread. Note: since
2// the implementation of std::thread uses the shared pointer implementation,
3// that implementation has to be annotated in order to avoid false positives.
4// See also http://gcc.gnu.org/onlinedocs/libstdc++/manual/debug.html for more
5// information.
6
7#include "../../drd/drd.h"
8#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(addr) \
9 ANNOTATE_HAPPENS_BEFORE(addr)
10#define _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(addr) \
11 ANNOTATE_HAPPENS_AFTER(addr)
12#define _GLIBCXX_EXTERN_TEMPLATE -1
13
14#include <iostream>
15#include <thread>
16
17int main(int argc, char** argv)
18{
19 std::thread t( []() { } );
20 t.join();
21 std::cerr << "Done.\n";
22 return 0;
23}