/unit/src/ |
H A D | nxt_time.c | 27 struct timespec ts; in nxt_realtime() local 32 now->nsec = ts.tv_nsec; in nxt_realtime() 51 struct timespec ts; in nxt_realtime() local 56 now->nsec = ts.tv_nsec; in nxt_realtime() 74 struct timespec ts; in nxt_realtime() local 115 struct timespec ts; in nxt_monotonic_time() local 119 now->monotonic = (nxt_nsec_t) ts.tv_sec * 1000000000 + ts.tv_nsec; in nxt_monotonic_time() 138 struct timespec ts; in nxt_monotonic_time() local 142 now->monotonic = (nxt_nsec_t) ts.tv_sec * 1000000000 + ts.tv_nsec; in nxt_monotonic_time() 192 struct timespec ts; in nxt_monotonic_time() local [all …]
|
H A D | nxt_thread_time.c | 38 nxt_time_string_t *ts, u_char *buf); 239 slot = nxt_thread_time_string_slot(ts); in nxt_thread_time_string() 260 if (ts->msec == NXT_THREAD_TIME_MSEC in nxt_thread_time_string() 274 if (ts->timezone == NXT_THREAD_TIME_LOCAL) { in nxt_thread_time_string() 325 p = nxt_zalloc(ts->size); in nxt_thread_time_string() 335 p = ts->handler(p, &thr->time.now.realtime, tm, ts->size, ts->format); in nxt_thread_time_string() 359 if (ts->timezone == NXT_THREAD_TIME_LOCAL) { in nxt_thread_time_string_no_cache() 373 return ts->handler(buf, &now, &tm, ts->size, ts->format); in nxt_thread_time_string_no_cache() 378 nxt_thread_time_string_slot(nxt_time_string_t *ts) in nxt_thread_time_string_slot() argument 388 if (nxt_atomic_cmp_set(&ts->slot, -1, -2)) { in nxt_thread_time_string_slot() [all …]
|
H A D | nxt_buf.c | 60 nxt_buf_ts_t *ts; in nxt_buf_mem_ts_alloc() local 83 ts = nxt_pointer_to(b, NXT_BUF_MEM_SIZE); in nxt_buf_mem_ts_alloc() 84 ts->engine = task->thread->engine; in nxt_buf_mem_ts_alloc() 86 ts->work.handler = nxt_buf_ts_completion; in nxt_buf_mem_ts_alloc() 87 ts->work.task = task; in nxt_buf_mem_ts_alloc() 88 ts->work.obj = b; in nxt_buf_mem_ts_alloc() 89 ts->work.data = b->parent; in nxt_buf_mem_ts_alloc() 244 nxt_buf_ts_t *ts; in nxt_buf_ts_handle() local 258 ts->work.obj = obj; in nxt_buf_ts_handle() 259 ts->work.data = data; in nxt_buf_ts_handle() [all …]
|
H A D | nxt_thread_cond.c | 65 struct timespec ts; in nxt_thread_cond_wait() local 90 ts.tv_sec = now->sec + ns / 1000000000; in nxt_thread_cond_wait() 91 ts.tv_nsec = ns % 1000000000; in nxt_thread_cond_wait() 93 err = pthread_cond_timedwait(cond, mtx, &ts); in nxt_thread_cond_wait()
|
H A D | nxt_semaphore.c | 82 struct timespec ts; in nxt_sem_wait() local 134 ts.tv_sec = now->sec + ns / 1000000000; in nxt_sem_wait() 135 ts.tv_nsec = ns % 1000000000; in nxt_sem_wait() 138 n = sem_timedwait(sem, &ts); in nxt_sem_wait()
|
H A D | nxt_listen_socket.c | 42 nxt_socket_t ts; in nxt_listen_socket_create() local 152 ts = nxt_socket_create(task, AF_UNIX, SOCK_STREAM, 0, 0); in nxt_listen_socket_create() 153 if (ts == -1) { in nxt_listen_socket_create() 157 ret = connect(ts, &orig_sa->u.sockaddr, orig_sa->socklen); in nxt_listen_socket_create() 161 nxt_socket_close(task, ts); in nxt_listen_socket_create() 165 ts, (size_t) orig_sa->length, in nxt_listen_socket_create() 173 ts, (size_t) orig_sa->length, in nxt_listen_socket_create()
|
H A D | nxt_thread_time.h | 69 nxt_time_string_t *ts, u_char *buf);
|
H A D | nxt_eventport_engine.c | 457 timespec_t ts, *tp; in nxt_eventport_poll() local 473 ts.tv_sec = timeout / 1000; in nxt_eventport_poll() 474 ts.tv_nsec = (timeout % 1000) * 1000000; in nxt_eventport_poll() 475 tp = &ts; in nxt_eventport_poll()
|
H A D | nxt_process.c | 977 struct timespec ts; in nxt_nanosleep() local 979 ts.tv_sec = ns / 1000000000; in nxt_nanosleep() 980 ts.tv_nsec = ns % 1000000000; in nxt_nanosleep() 982 (void) nanosleep(&ts, NULL); in nxt_nanosleep()
|
H A D | nxt_kqueue_engine.c | 675 struct timespec ts, *tp; in nxt_kqueue_poll() local 684 ts.tv_sec = timeout / 1000; in nxt_kqueue_poll() 685 ts.tv_nsec = (timeout % 1000) * 1000000; in nxt_kqueue_poll() 686 tp = &ts; in nxt_kqueue_poll()
|
H A D | nxt_unit.c | 6671 struct timespec ts; in nxt_unit_snprint_prefix() local 6673 (void) clock_gettime(CLOCK_REALTIME, &ts); in nxt_unit_snprint_prefix() 6676 (void) localtime_r(&ts.tv_sec, &tm); in nxt_unit_snprint_prefix() 6678 tm = *localtime(&ts.tv_sec); in nxt_unit_snprint_prefix() 6686 (int) ts.tv_nsec / 1000000); in nxt_unit_snprint_prefix()
|
/unit/auto/ |
H A D | time | 17 struct timespec ts; 19 if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1) 40 struct timespec ts; 42 if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1) 57 struct timespec ts; 59 if (clock_gettime(CLOCK_REALTIME, &ts) == -1) 91 struct timespec ts; 114 struct timespec ts; 116 if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1) 131 struct timespec ts; [all …]
|
H A D | threads | 135 struct timespec ts; 142 ts.tv_sec = 0; 143 ts.tv_nsec = 0; 144 if (sem_timedwait(&sem, &ts) != 0)
|