adapted tests
This commit is contained in:
@@ -29,11 +29,44 @@ private:
|
||||
public:
|
||||
void push(T const& value)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
std::lock_guard lock(this->mutex);
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(this->d_mutex);
|
||||
p_queue.push(value);
|
||||
}
|
||||
this->d_condition.notify_one();
|
||||
=======
|
||||
this->promise.set_value(value);
|
||||
return;
|
||||
>>>>>>> 3e086976076bbe7c104001de6366eff270d039fb
|
||||
}
|
||||
p_queue.push(value);
|
||||
}
|
||||
>>>>>>> a8eddc165087dba2da234c0f3cbe38dd185c26d7
|
||||
|
||||
p_queue.push(value);
|
||||
|
||||
<<<<<<< HEAD
|
||||
wait_condition.notify_one();
|
||||
=======
|
||||
auto status = future_pop.wait_for(std::chrono::seconds(0));
|
||||
if(status == std::future_status::ready)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
// TODO die queue funzt net weil wir nich pushen koennen wenn wir im pop warten
|
||||
// TODO denk ma ueber future nach
|
||||
std::unique_lock<std::mutex> lock(this->d_mutex);
|
||||
this->d_condition.wait(lock, [=]{ return !this->p_queue.empty(); });
|
||||
T rc = *this->p_queue.begin();
|
||||
this->p_queue.pop();
|
||||
return rc;
|
||||
=======
|
||||
return future_pop.get();
|
||||
>>>>>>> 3e086976076bbe7c104001de6366eff270d039fb
|
||||
>>>>>>> a8eddc165087dba2da234c0f3cbe38dd185c26d7
|
||||
}
|
||||
|
||||
T pop()
|
||||
|
||||
Reference in New Issue
Block a user