Data Structures | Macros | Typedefs
loop.h File Reference
#include <stdint.h>
#include <uv.h>
#include "nvim/event/multiqueue.h"
#include "nvim/lib/klist.h"
#include "nvim/os/time.h"

Go to the source code of this file.

Data Structures

struct  loop
 

Macros

#define _noop(x)
 
#define CREATE_EVENT(multiqueue, handler, argc, ...)
 
#define LOOP_PROCESS_EVENTS_UNTIL(loop, multiqueue, timeout, condition)
 
#define LOOP_PROCESS_EVENTS(loop, multiqueue, timeout)
 

Typedefs

typedef voidWatcherPtr
 
typedef struct loop Loop
 

Macro Definition Documentation

◆ _noop

#define _noop (   x)

◆ CREATE_EVENT

#define CREATE_EVENT (   multiqueue,
  handler,
  argc,
  ... 
)
Value:
do { \
if (multiqueue) { \
multiqueue_put((multiqueue), (handler), argc, __VA_ARGS__); \
} else { \
void *argv[argc] = { __VA_ARGS__ }; \
(handler)(argv); \
} \
} while (0)

◆ LOOP_PROCESS_EVENTS

#define LOOP_PROCESS_EVENTS (   loop,
  multiqueue,
  timeout 
)
Value:
do { \
multiqueue_process_events(multiqueue); \
} else { \
loop_poll_events(loop, timeout); \
} \
} while (0)

◆ LOOP_PROCESS_EVENTS_UNTIL

#define LOOP_PROCESS_EVENTS_UNTIL (   loop,
  multiqueue,
  timeout,
  condition 
)
Value:
do { \
int remaining = timeout; \
uint64_t before = (remaining > 0) ? os_hrtime() : 0; \
while (!(condition)) { \
LOOP_PROCESS_EVENTS(loop, multiqueue, remaining); \
if (remaining == 0) { \
break; \
} else if (remaining > 0) { \
uint64_t now = os_hrtime(); \
remaining -= (int)((now - before) / 1000000); \
before = now; \
if (remaining <= 0) { \
break; \
} \
} \
} \
} while (0)

Typedef Documentation

◆ Loop

typedef struct loop Loop

◆ WatcherPtr

typedef void* WatcherPtr
multiqueue_empty
bool multiqueue_empty(MultiQueue *this)
Definition: multiqueue.c:168
argv
static int typval_T argv[3]
Definition: eval.c:6533
multiqueue
Definition: multiqueue.c:71
os_hrtime
uint64_t os_hrtime(void)
Definition: time.c:36
loop
Definition: loop.h:16