You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
578 B
28 lines
578 B
4 months ago
|
// This file is used from other tests.
|
||
|
// RUN: true
|
||
|
|
||
|
#include <thread>
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
struct MyObject;
|
||
|
typedef MyObject *MyObjectRef;
|
||
|
extern "C" {
|
||
|
void InitializeLibrary();
|
||
|
MyObject *ObjectCreate();
|
||
|
long ObjectRead(MyObject *);
|
||
|
void ObjectWrite(MyObject *, long);
|
||
|
void ObjectWriteAnother(MyObject *, long);
|
||
|
}
|
||
|
|
||
|
extern "C" void NonInstrumentedModule() {
|
||
|
InitializeLibrary();
|
||
|
|
||
|
MyObjectRef ref = ObjectCreate();
|
||
|
std::thread t1([ref]{ ObjectWrite(ref, 42); });
|
||
|
std::thread t2([ref]{ ObjectWrite(ref, 43); });
|
||
|
t1.join();
|
||
|
t2.join();
|
||
|
}
|