Skip to content
Snippets Groups Projects
Commit 2f0eaa68 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by gerrit2
Browse files

alsa: fix possible threading issue

An std::thread, ctor constructer, must be the last members in a class to be sure
that all previous members are initialized in class ctor before to run the thread
itself.
This may fixes random issues seen with others member accesses.

Change-Id: I7ceb0cf522236411f4a2faa34ff4f32eae0e4c13
Tuleap: #171
parent 131301b4
No related branches found
No related tags found
No related merge requests found
......@@ -44,12 +44,11 @@ class AlsaThread {
bool isRunning() const;
private:
void run();
NON_COPYABLE(AlsaThread);
std::thread thread_;
void run();
AlsaLayer* alsa_;
std::atomic<bool> running_;
std::thread thread_;
};
AlsaThread::AlsaThread(AlsaLayer *alsa)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment