[ovs-dev] [threads 08/17] timeval: Remove time_disable_restart(), time_enable_restart() functions.

Ben Pfaff blp at nicira.com
Wed Jun 5 20:05:13 UTC 2013


These functions will not have the same useful effect when Open vSwitch
becomes multithreaded, because time_disable_restart() will disable time
advancing for every thread, not just for the thread that calls it.

These functions are no longer used, so this commit removes them.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/timeval.c |   29 -----------------------------
 lib/timeval.h |    2 --
 2 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/lib/timeval.c b/lib/timeval.c
index d2b7508..5ff59bc 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -167,35 +167,6 @@ set_up_signal(int flags)
     xsigaction(SIGALRM, &sa, NULL);
 }
 
-/* Remove SA_RESTART from the flags for SIGALRM, so that any system call that
- * is interrupted by the periodic timer interrupt will return EINTR instead of
- * continuing after the signal handler returns.
- *
- * time_disable_restart() and time_enable_restart() may be usefully wrapped
- * around function calls that might otherwise block forever unless interrupted
- * by a signal, e.g.:
- *
- *   time_disable_restart();
- *   fcntl(fd, F_SETLKW, &lock);
- *   time_enable_restart();
- */
-void
-time_disable_restart(void)
-{
-    time_init();
-    set_up_signal(0);
-}
-
-/* Add SA_RESTART to the flags for SIGALRM, so that any system call that
- * is interrupted by the periodic timer interrupt will continue after the
- * signal handler returns instead of returning EINTR. */
-void
-time_enable_restart(void)
-{
-    time_init();
-    set_up_signal(SA_RESTART);
-}
-
 static void
 set_up_timer(void)
 {
diff --git a/lib/timeval.h b/lib/timeval.h
index b74fe12..eff28e2 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -57,8 +57,6 @@ BUILD_ASSERT_DECL(TYPE_IS_SIGNED(time_t));
 #endif
 #endif /* ifndef CACHE_TIME */
 
-void time_disable_restart(void);
-void time_enable_restart(void);
 void time_postfork(void);
 void time_refresh(void);
 time_t time_now(void);
-- 
1.7.2.5




More information about the dev mailing list