[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/NEWLIB PATCH] time: Use new uk_sched_thread_sleep() function to implement msleep



This patch wont work properly since parameter of ukplat_lcpu_halt_to() is an "until" timestamp. It may also come back earlier because of an arrived interrupt. So I am taking this patch back ;-)

On 15.06.2018 15:03, Simon Kuenzer wrote:
This interface has been changed on Unikraft with the latest version.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
  time.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/time.c b/time.c
index 3196ad8..086f4c5 100644
--- a/time.c
+++ b/time.c
@@ -40,9 +40,11 @@
  #include <uk/config.h>
  #if CONFIG_HAVE_SCHED
  #include <uk/sched.h>
+#include <uk/thread.h>
  #else
  #include <uk/plat/lcpu.h>
  #endif
+#include <uk/arch/time.h>
int
  gettimeofday(struct timeval *tv __unused, void *tz __unused)
@@ -59,7 +61,7 @@ int utime(const char *filename __unused, const struct utimbuf 
*times __unused)
  static void msleep(uint32_t milliseconds)
  {
  #if CONFIG_HAVE_SCHED
-       uk_sched_sleep(milliseconds);
+       uk_sched_thread_sleep(ukarch_time_msec_to_nsec((__nsec) milliseconds));
  #else
        ukplat_lcpu_halt_to(milliseconds);
  #endif


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.