Merge "liblog: minimum_log_priority should be atomic" am: ce71d36d13 am: 7b12b02c89
Change-Id: I8b0bdf5447051b9a1f3d2dc87483fffaf08228c1
This commit is contained in:
commit
8061043db6
1 changed files with 3 additions and 4 deletions
|
|
@ -27,6 +27,7 @@
|
|||
#include <android/set_abort_message.h>
|
||||
#endif
|
||||
|
||||
#include <atomic>
|
||||
#include <shared_mutex>
|
||||
|
||||
#include <android-base/errno_restorer.h>
|
||||
|
|
@ -148,11 +149,9 @@ void __android_log_set_default_tag(const char* tag) {
|
|||
GetDefaultTag().assign(tag, 0, LOGGER_ENTRY_MAX_PAYLOAD);
|
||||
}
|
||||
|
||||
static int minimum_log_priority = ANDROID_LOG_DEFAULT;
|
||||
static std::atomic_int minimum_log_priority = ANDROID_LOG_DEFAULT;
|
||||
int __android_log_set_minimum_priority(int priority) {
|
||||
int old_minimum_log_priority = minimum_log_priority;
|
||||
minimum_log_priority = priority;
|
||||
return old_minimum_log_priority;
|
||||
return minimum_log_priority.exchange(priority, std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
int __android_log_get_minimum_priority() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue