mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
add minimally broken example
This commit is contained in:
parent
9537ccf2d2
commit
b1ad7590cc
@ -299,6 +299,7 @@ endif (OPT_BUILD_SCHEDULER)
|
||||
|
||||
if (MSVC)
|
||||
add_executable(sdrpp "src/main.cpp" "win32/resources.rc")
|
||||
add_executable(min_broken "min_broken/main.cpp" "win32/resources.rc")
|
||||
else ()
|
||||
add_executable(sdrpp "src/main.cpp")
|
||||
endif ()
|
||||
|
26
min_broken/main.cpp
Normal file
26
min_broken/main.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <mutex>
|
||||
|
||||
class TestClass {
|
||||
public:
|
||||
TestClass() {
|
||||
std::lock_guard<std::recursive_mutex> lck(mtx);
|
||||
value = 42;
|
||||
}
|
||||
|
||||
int getValue() {
|
||||
std::lock_guard<std::recursive_mutex> lck(mtx);
|
||||
return value;
|
||||
}
|
||||
|
||||
private:
|
||||
std::recursive_mutex mtx;
|
||||
int value = 0;
|
||||
};
|
||||
|
||||
TestClass test;
|
||||
|
||||
int main() {
|
||||
printf("Value: %d\n", test.getValue());
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user