| 1 | // This file is used from other tests. |
| 2 | // RUN: true |
| 3 | |
| 4 | #include <thread> |
| 5 | |
| 6 | #include <stdio.h> |
| 7 | #include <stdlib.h> |
| 8 | |
| 9 | struct MyObject; |
| 10 | typedef MyObject *MyObjectRef; |
| 11 | extern "C" { |
| 12 | void InitializeLibrary(); |
| 13 | MyObject *ObjectCreate(); |
| 14 | long ObjectRead(MyObject *); |
| 15 | void ObjectWrite(MyObject *, long); |
| 16 | void ObjectWriteAnother(MyObject *, long); |
| 17 | } |
| 18 | |
| 19 | extern "C" void NonInstrumentedModule() { |
| 20 | InitializeLibrary(); |
| 21 | |
| 22 | MyObjectRef ref = ObjectCreate(); |
| 23 | std::thread t1([ref]{ ObjectWrite(ref, 42); }); |
| 24 | std::thread t2([ref]{ ObjectWrite(ref, 43); }); |
| 25 | t1.join(); |
| 26 | t2.join(); |
| 27 | } |
| 28 | |