Skip to content

Commit 600aec2

Browse files
authored
Merge pull request #155 from Countly/cmake-update
Cmake update
2 parents 2ec6f1f + dbdabc1 commit 600aec2

8 files changed

Lines changed: 349 additions & 196 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 26.1.1
2+
- Updated CMake minimum required version to use the range format with upper the end of `3.31`.
3+
- Hardened mutex handling against exceptions.
4+
15
## 26.1.0
26
- ! Minor breaking change ! SDK Behavior Settings is now enabled by default. Changes made on SDK Manager > SDK Behavior Settings on your server will affect SDK behavior directly.
37

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.0...3.31)
22

33
# Acquire countly version from constant
44
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/include/countly/constants.hpp COUNTLY_HPP_CONTENTS)
@@ -119,6 +119,7 @@ if(COUNTLY_BUILD_TESTS)
119119
${CMAKE_CURRENT_SOURCE_DIR}/tests/request.cpp
120120
${CMAKE_CURRENT_SOURCE_DIR}/tests/config.cpp
121121
${CMAKE_CURRENT_SOURCE_DIR}/tests/immediate_stop.cpp
122+
${CMAKE_CURRENT_SOURCE_DIR}/tests/mutex_exception_safety.cpp
122123
${CMAKE_CURRENT_SOURCE_DIR}/tests/sbs.cpp)
123124

124125
target_compile_options(countly-tests PRIVATE -g)

include/countly.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,14 @@ class Countly : public cly::CountlyDelegates {
313313
*/
314314
std::vector<std::string> debugReturnStateOfEQ();
315315

316+
/**
317+
* Injects a raw (possibly malformed) string directly into the in-memory event
318+
* queue, bypassing serialization. Used only by the mutex exception-safety test
319+
* to force a parse failure inside the locked section of updateSession().
320+
* Warning: This method is for debugging purposes, and it is going to be removed in the future.
321+
*/
322+
void debugInjectRawEvent(const std::string &raw);
323+
316324
/**
317325
* This function should not be used as it will be removed in a future release.
318326
* It is currently added as a temporary workaround.
@@ -331,6 +339,8 @@ class Countly : public cly::CountlyDelegates {
331339

332340
inline void clearRequestQueue() {
333341
if (is_sdk_initialized) {
342+
// serialize storage access with the background processQueue thread
343+
std::lock_guard<std::mutex> lk(*mutex);
334344
requestModule->clearRequestQueue();
335345
}
336346
}

include/countly/constants.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <string>
1414

1515
#define COUNTLY_SDK_NAME "cpp-native-unknown"
16-
#define COUNTLY_SDK_VERSION "26.1.0"
16+
#define COUNTLY_SDK_VERSION "26.1.1"
1717
#define COUNTLY_POST_THRESHOLD 2000
1818
#define COUNTLY_KEEPALIVE_INTERVAL 3000
1919
#define COUNTLY_MAX_EVENTS_DEFAULT 200

0 commit comments

Comments
 (0)