fixing clang error

이 커밋은 다음에 포함됨:
Evgeny
2019-10-02 15:29:09 -05:00
부모 8a43ddfc82
커밋 a8c5e2edce
5개의 변경된 파일과 10개의 추가작업 그리고 7개의 파일을 삭제
+4 -3
파일 보기
@@ -1,6 +1,7 @@
#ifndef SRC_CORE_TRACE_BUFFER_H_
#define SRC_CORE_TRACE_BUFFER_H_
#include <atomic>
#include <list>
#include <mutex>
#include <pthread.h>
@@ -66,7 +67,7 @@ class TraceBuffer {
};
TraceBuffer(const char* name, uint32_t size, flush_prm_t* flush_prm_arr, uint32_t flush_prm_count) :
is_flushed_(ATOMIC_FLAG_INIT)
is_flushed_(false)
{
name_ = strdup(name);
size_ = size;
@@ -108,7 +109,7 @@ class TraceBuffer {
private:
void flush_buf() {
std::lock_guard<mutex_t> lck(mutex_);
const bool is_flushed = atomic_flag_test_and_set_explicit(&is_flushed_, std::memory_order_acquire);
const bool is_flushed = is_flushed_.exchange(true, std::memory_order_acquire);
if (is_flushed == false) {
for (flush_prm_t* prm = flush_prm_arr_; prm < flush_prm_arr_ + flush_prm_count_; prm++) {
@@ -183,7 +184,7 @@ class TraceBuffer {
flush_prm_t* flush_prm_arr_;
uint32_t flush_prm_count_;
volatile std::atomic_flag is_flushed_;
volatile std::atomic<bool> is_flushed_;
pthread_t work_thread_;
pthread_mutex_t work_mutex_;
+2
파일 보기
@@ -64,8 +64,10 @@ THE SOFTWARE.
static thread_local std::stack<std::string> message_stack;
#if 0
static inline uint32_t GetPid() { return syscall(__NR_getpid); }
static inline uint32_t GetTid() { return syscall(__NR_gettid); }
#endif
////////////////////////////////////////////////////////////////////////////////
// Library errors enumaration
+1 -1
파일 보기
@@ -225,7 +225,7 @@ class HsaRsrcFactory {
static void Destroy() {
std::lock_guard<mutex_t> lck(mutex_);
if (instance_) delete instance_;
if (instance_) delete instance_.load();
instance_ = NULL;
}
+1 -1
파일 보기
@@ -90,7 +90,7 @@ class Logger {
static void Destroy() {
std::lock_guard<mutex_t> lck(mutex_);
if (instance_ != NULL) delete instance_;
if (instance_ != NULL) delete instance_.load();
instance_ = NULL;
}