mirror of
https://github.com/openvswitch/ovs
synced 2025-09-03 15:55:19 +00:00
utils: Introduce xsleep for RCU quiescent state
Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -416,7 +416,7 @@ monitor_daemon(pid_t daemon_pid)
|
|||||||
if (now >= wakeup) {
|
if (now >= wakeup) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sleep(wakeup - now);
|
xsleep(wakeup - now);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
last_restart = time(NULL);
|
last_restart = time(NULL);
|
||||||
|
12
lib/util.c
12
lib/util.c
@@ -30,6 +30,7 @@
|
|||||||
#include "bitmap.h"
|
#include "bitmap.h"
|
||||||
#include "byte-order.h"
|
#include "byte-order.h"
|
||||||
#include "coverage.h"
|
#include "coverage.h"
|
||||||
|
#include "ovs-rcu.h"
|
||||||
#include "ovs-thread.h"
|
#include "ovs-thread.h"
|
||||||
#include "vlog.h"
|
#include "vlog.h"
|
||||||
#ifdef HAVE_PTHREAD_SET_NAME_NP
|
#ifdef HAVE_PTHREAD_SET_NAME_NP
|
||||||
@@ -1726,6 +1727,17 @@ exit:
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int
|
||||||
|
xsleep(unsigned int seconds)
|
||||||
|
{
|
||||||
|
unsigned int t;
|
||||||
|
|
||||||
|
ovsrcu_quiesce_start();
|
||||||
|
t = sleep(seconds);
|
||||||
|
ovsrcu_quiesce_end();
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
@@ -507,6 +507,7 @@ char *ovs_format_message(int error);
|
|||||||
char *ovs_lasterror_to_string(void);
|
char *ovs_lasterror_to_string(void);
|
||||||
int ftruncate(int fd, off_t length);
|
int ftruncate(int fd, off_t length);
|
||||||
#endif
|
#endif
|
||||||
|
unsigned int xsleep(unsigned int seconds);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user