X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5089a0a98b27f5eeee62321dff4f025f1648f025..7f04b8da22012c07a6d7fd559c9164141d293ca3:/src/s4u/s4u_Io.cpp diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index cca68b0156..9b363ce0d1 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -1,4 +1,4 @@ -/* 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. */ @@ -56,14 +56,14 @@ Io* Io::cancel() 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() @@ -76,9 +76,12 @@ 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 */