mirror of https://github.com/PentHertz/srsLTE.git
block_queue: use class mutex to protect size() getter
detected with TSAN
This commit is contained in:
parent
fb4dd3ba7b
commit
626f24c9f9
|
@ -121,7 +121,14 @@ public:
|
|||
|
||||
const myobj& front() const { return q.front(); }
|
||||
|
||||
size_t size() { return q.size(); }
|
||||
size_t size()
|
||||
{
|
||||
size_t len = 0;
|
||||
pthread_mutex_lock(&mutex);
|
||||
len = q.size();
|
||||
pthread_mutex_unlock(&mutex);
|
||||
return len;
|
||||
}
|
||||
|
||||
private:
|
||||
bool pop_(myobj* value, bool block)
|
||||
|
|
Loading…
Reference in New Issue