Showing with 22 additions and 15 deletions.
  1. +1 −1 src/unix/aix.c
  2. +6 −1 src/unix/core.c
  3. +2 −1 src/unix/cygwin.c
  4. +1 −1 src/unix/darwin.c
  5. +1 −1 src/unix/freebsd.c
  6. +1 −0 src/unix/internal.h
  7. +1 −1 src/unix/kqueue.c
  8. +2 −2 src/unix/linux/linux-core.c
  9. +1 −1 src/unix/loop.c
  10. +1 −1 src/unix/netbsd.c
  11. +1 −1 src/unix/openbsd.c
  12. +3 −3 src/unix/sunos.c
  13. +1 −1 src/unix/thread.c
@@ -45,7 +45,7 @@
#include <sys/proc.h>
#include <sys/procfs.h>

uint64_t uv_hrtime() {
uint64_t uv__hrtime(void) {
uint64_t G = 1000000000;
timebasestruct_t t;
read_wall_time(&t, TIMEBASE_SZ);
@@ -66,6 +66,11 @@ static uv_loop_t default_loop_struct;
static uv_loop_t* default_loop_ptr;


uint64_t uv_hrtime(void) {
return uv__hrtime();
}


void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
assert(!(handle->flags & (UV_CLOSING | UV_CLOSED)));

@@ -302,7 +307,7 @@ int uv_run(uv_loop_t* loop) {


void uv_update_time(uv_loop_t* loop) {
loop->time = uv_hrtime() / 1000000;
loop->time = uv__hrtime() / 1000000;
}


@@ -41,12 +41,13 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}


uint64_t uv_hrtime() {
uint64_t uv__hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
}


void uv_loadavg(double avg[3]) {
/* Unsupported as of cygwin 1.7.7 */
avg[0] = avg[1] = avg[2] = 0;
@@ -176,7 +176,7 @@ void uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg) {
}


uint64_t uv_hrtime(void) {
uint64_t uv__hrtime(void) {
mach_timebase_info_data_t info;

if (mach_timebase_info(&info) != KERN_SUCCESS)
@@ -63,7 +63,7 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}


uint64_t uv_hrtime(void) {
uint64_t uv__hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
@@ -174,6 +174,7 @@ void uv__work_submit(uv_loop_t* loop,
void uv__work_done(uv_async_t* handle, int status);

/* platform specific */
uint64_t uv__hrtime(void);
int uv__kqueue_init(uv_loop_t* loop);
int uv__platform_loop_init(uv_loop_t* loop, int default_loop);
void uv__platform_loop_delete(uv_loop_t* loop);
@@ -244,7 +244,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
update_timeout:
assert(timeout > 0);

diff = uv_hrtime() / 1000000;
diff = uv__hrtime() / 1000000;
assert(diff >= base);
diff -= base;

@@ -243,7 +243,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
update_timeout:
assert(timeout > 0);

diff = uv_hrtime() / 1000000;
diff = uv__hrtime() / 1000000;
assert(diff >= base);
diff -= base;

@@ -255,7 +255,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
}


uint64_t uv_hrtime() {
uint64_t uv__hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
@@ -49,7 +49,7 @@ int uv__loop_init(uv_loop_t* loop, int default_loop) {
ngx_queue_init(&loop->watcher_queue);

loop->closing_handles = NULL;
loop->time = uv_hrtime() / 1000000;
loop->time = uv__hrtime() / 1000000;
loop->async_pipefd[0] = -1;
loop->async_pipefd[1] = -1;
loop->signal_pipefd[0] = -1;
@@ -56,7 +56,7 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}


uint64_t uv_hrtime(void) {
uint64_t uv__hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
@@ -52,7 +52,7 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
}


uint64_t uv_hrtime(void) {
uint64_t uv__hrtime(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (((uint64_t) ts.tv_sec) * NANOSEC + ts.tv_nsec);
@@ -211,7 +211,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
update_timeout:
assert(timeout > 0);

diff = uv_hrtime() / 1000000;
diff = uv__hrtime() / 1000000;
assert(diff >= base);
diff -= base;

@@ -223,8 +223,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
}


uint64_t uv_hrtime() {
return (gethrtime());
uint64_t uv__hrtime(void) {
return gethrtime();
}


@@ -354,7 +354,7 @@ int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
struct timespec ts;
uint64_t abstime;

abstime = uv_hrtime() + timeout;
abstime = uv__hrtime() + timeout;
ts.tv_sec = abstime / NANOSEC;
ts.tv_nsec = abstime % NANOSEC;
r = pthread_cond_timedwait(cond, mutex, &ts);