[mpp_lock]: Add gcc atomic macro define

Change-Id: I3e94cc7be9a51f5d674a132c0a2e6f7afba61d34
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2021-11-03 11:25:02 +08:00
parent 786b79f976
commit f0c57cde02
6 changed files with 50 additions and 28 deletions

View File

@@ -25,6 +25,7 @@
#include "mpp_env.h"
#include "mpp_mem.h"
#include "mpp_log.h"
#include "mpp_lock.h"
#include "mpp_time.h"
#include "mpp_common.h"
#include "mpp_buffer.h"
@@ -403,7 +404,7 @@ void reader_stop(FileReader reader)
{
FileReaderImpl *impl = (FileReaderImpl*)reader;
if (__sync_bool_compare_and_swap(&impl->thd_stop, 0, 1))
if (MPP_BOOL_CAS(&impl->thd_stop, 0, 1))
pthread_join(impl->thd, NULL);
}