Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / src / s4u / s4u_Io.cpp
index cca68b0..9b363ce 100644 (file)
@@ -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 */