Modify os_cond_reltimedwait to support long time wait (#461)
Modify the argument of os_cond_reltimedwait to uint64 type to support long time wait, and handle possible integer overflow.
This commit is contained in:
@ -138,7 +138,7 @@ int os_cond_wait(korp_cond *cond, korp_mutex *mutex);
|
||||
*
|
||||
* @return 0 if success
|
||||
*/
|
||||
int os_cond_reltimedwait(korp_cond *cond, korp_mutex *mutex, int useconds);
|
||||
int os_cond_reltimedwait(korp_cond *cond, korp_mutex *mutex, uint64 useconds);
|
||||
|
||||
/**
|
||||
* Signals the condition variable
|
||||
|
||||
@ -19,8 +19,7 @@ extern "C" {
|
||||
#define BHT_TIMED_OUT (1)
|
||||
#define BHT_OK (0)
|
||||
|
||||
#define BHT_NO_WAIT 0x00000000
|
||||
#define BHT_WAIT_FOREVER 0xFFFFFFFF
|
||||
#define BHT_WAIT_FOREVER ((uint64)-1LL)
|
||||
|
||||
#define BH_KB (1024)
|
||||
#define BH_MB ((BH_KB)*1024)
|
||||
|
||||
Reference in New Issue
Block a user