mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 15:25:22 +00:00
util: xleep for Windows.
Windows does not have a sleep(seconds). But it does have
a Sleep(milliseconds). Sleep() in windows does not have a
return value. Since we are not using the return value for xsleep()
anywhere as of now, don't return any.
Introduced by commit 275eebb9
(utils: Introduce xsleep for RCU quiescent state)
CC: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
11
lib/util.c
11
lib/util.c
@@ -1727,15 +1727,16 @@ exit:
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
void
|
||||||
xsleep(unsigned int seconds)
|
xsleep(unsigned int seconds)
|
||||||
{
|
{
|
||||||
unsigned int t;
|
|
||||||
|
|
||||||
ovsrcu_quiesce_start();
|
ovsrcu_quiesce_start();
|
||||||
t = sleep(seconds);
|
#ifdef _WIN32
|
||||||
|
Sleep(seconds * 1000);
|
||||||
|
#else
|
||||||
|
sleep(seconds);
|
||||||
|
#endif
|
||||||
ovsrcu_quiesce_end();
|
ovsrcu_quiesce_end();
|
||||||
return t;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@@ -502,13 +502,13 @@ void bitwise_put(uint64_t value,
|
|||||||
uint64_t bitwise_get(const void *src, unsigned int src_len,
|
uint64_t bitwise_get(const void *src, unsigned int src_len,
|
||||||
unsigned int src_ofs, unsigned int n_bits);
|
unsigned int src_ofs, unsigned int n_bits);
|
||||||
|
|
||||||
|
void xsleep(unsigned int seconds);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
char *ovs_format_message(int error);
|
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