A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update python/clusters-multicpu to the new API.
[simgrid.git]
/
include
/
simgrid
/
plugins
/
ProducerConsumer.hpp
diff --git
a/include/simgrid/plugins/ProducerConsumer.hpp
b/include/simgrid/plugins/ProducerConsumer.hpp
index 44e2f272308c6b34d75952425babdcdeb2a882b3..d4438e4ad72327e88dd519d861e2ab0da0229a70 100644
(file)
--- a/
include/simgrid/plugins/ProducerConsumer.hpp
+++ b/
include/simgrid/plugins/ProducerConsumer.hpp
@@
-103,7
+103,7
@@
public:
*/
ProducerConsumer* set_max_queue_size(unsigned int max_queue_size)
{
*/
ProducerConsumer* set_max_queue_size(unsigned int max_queue_size)
{
- const std::
lock_guard<s4u::Mutex>
lock(*mutex_);
+ const std::
scoped_lock
lock(*mutex_);
max_queue_size_ = max_queue_size;
return this;
}
max_queue_size_ = max_queue_size;
return this;
}
@@
-140,7
+140,7
@@
public:
*/
s4u::CommPtr put_async(T* data, size_t simulated_size_in_bytes)
{
*/
s4u::CommPtr put_async(T* data, size_t simulated_size_in_bytes)
{
- std::unique_lock
<s4u::Mutex>
lock(*mutex_);
+ std::unique_lock lock(*mutex_);
s4u::CommPtr comm = nullptr;
XBT_CVERB(producer_consumer, (size() < max_queue_size_) ? "can put" : "must wait");
s4u::CommPtr comm = nullptr;
XBT_CVERB(producer_consumer, (size() < max_queue_size_) ? "can put" : "must wait");
@@
-177,7
+177,7
@@
public:
*/
s4u::CommPtr get_async(T** data)
{
*/
s4u::CommPtr get_async(T** data)
{
- std::unique_lock
<s4u::Mutex>
lock(*mutex_);
+ std::unique_lock lock(*mutex_);
s4u::CommPtr comm = nullptr;
XBT_CVERB(producer_consumer, empty() ? "must wait" : "can get");
while (empty())
s4u::CommPtr comm = nullptr;
XBT_CVERB(producer_consumer, empty() ? "must wait" : "can get");
while (empty())