-/* Copyright (c) 2018-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2018-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
Io* Io::wait()
{
- simcall_io_wait(pimpl_);
- state_ = State::FINISHED;
- return this;
+ return this->wait_for(-1);
}
-Io* Io::wait_for(double)
+Io* Io::wait_for(double timeout)
{
- THROW_UNIMPLEMENTED;
+ simcall_io_wait(pimpl_, timeout);
+ state_ = State::FINISHED;
+ return this;
}
bool Io::test()
if (state_ == State::INITED)
this->start();
- THROW_UNIMPLEMENTED;
+ if (simcall_io_test(pimpl_)) {
+ state_ = State::FINISHED;
+ return true;
+ }
- // return false
+ return false;
}
/** @brief Returns the amount of flops that remain to be done */