1 ---------------------------------
5 ---------------------------------
9 local
ffi = require
"ffi"
14 struct barrier* make_barrier(
size_t n);
15 void barrier_wait(
struct barrier* barrier);
16 void barrier_reinit(
struct barrier* barrier,
size_t n);
22 barrier.__index = barrier
27 return C.make_barrier(
n)
31 function barrier:wait()
36 --- only call if NO threads are waiting on this barrier
39 C.barrier_reinit(self,
n)
42 ffi.metatype("struct barrier", barrier)
local ffi
low-level dpdk wrapper
function barrier reinit(n)
only call if NO threads are waiting on this barrier
local mod
high-level dpdk wrapper
n
Create a new array of memory buffers (initialized to nil).