Skip to content
Snippets Groups Projects
Commit 3212effd authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #30600: video: use std::atomics

parent 5fc5c212
No related branches found
No related tags found
No related merge requests found
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include "sflthread.h" #include "sflthread.h"
#include "logger.h" #include "logger.h"
#define set_false_atomic(x) static_cast<void>(__sync_fetch_and_and(x, false))
void* SFLThread::run_(void* data) void* SFLThread::run_(void* data)
{ {
SFLThread *obj = static_cast<SFLThread*>(data); SFLThread *obj = static_cast<SFLThread*>(data);
...@@ -72,7 +70,7 @@ void SFLThread::start() ...@@ -72,7 +70,7 @@ void SFLThread::start()
void SFLThread::stop() void SFLThread::stop()
{ {
set_false_atomic(&running_); running_ = false;
} }
void SFLThread::join() void SFLThread::join()
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define __SFLTHREAD_H__ #define __SFLTHREAD_H__
#include <pthread.h> #include <pthread.h>
#include <atomic>
class SFLThread { class SFLThread {
public: public:
...@@ -56,7 +57,7 @@ private: ...@@ -56,7 +57,7 @@ private:
void mainloop_(); void mainloop_();
pthread_t thread_; pthread_t thread_;
bool running_; std::atomic<bool> running_;
}; };
#endif // __SFLTHREAD_H__ #endif // __SFLTHREAD_H__
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment