Use util::mutexed in audio::channel if atomic_ptr<shared_ptr> is not supported
This commit is contained in:
parent
99978c3241
commit
a9094975be
1 changed files with 13 additions and 3 deletions
|
|
@ -1,8 +1,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <psemek/audio/stream.hpp>
|
#include <version>
|
||||||
|
|
||||||
|
#include <psemek/audio/stream.hpp>
|
||||||
|
#ifdef __cpp_lib_atomic_shared_ptr
|
||||||
|
#include <atomic>
|
||||||
|
#else
|
||||||
|
#include <psemek/util/mutexed.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <atomic>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace psemek::audio
|
namespace psemek::audio
|
||||||
|
|
@ -37,7 +43,11 @@ namespace psemek::audio
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::atomic<stream_ptr> stream_;
|
#ifdef __cpp_lib_atomic_shared_ptr
|
||||||
|
std::atomic<stream_ptr> stream_;
|
||||||
|
#else
|
||||||
|
util::mutexed<stream_ptr> stream_;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
using channel_ptr = std::shared_ptr<channel>;
|
using channel_ptr = std::shared_ptr<channel>;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue