NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs
thread.h File Reference
#include "../core/common.h"
#include "thread-enum.h"

Go to the source code of this file.

Data Structures

struct  ThreadCtrl
 Thread load stats and stop flag. More...
 

Macros

#define ThreadCtrl_Continue(ctrl, count)
 Determine if a thread loop should continue. More...
 

Typedefs

typedef struct ThreadCtrl ThreadCtrl
 Thread load stats and stop flag. More...
 

Macro Definition Documentation

◆ ThreadCtrl_Continue

#define ThreadCtrl_Continue (   ctrl,
  count 
)
Value:
__extension__({ \
++(ctrl).nPolls[(int)((count) > 0)]; \
(ctrl).items += (count); \
if (count == 0) { \
ThreadCtrl_Sleep(&(ctrl)); \
} else { \
ThreadCtrl_SleepReset(&(ctrl)); \
} \
(count) = 0; \
atomic_load_explicit(&(ctrl).stop, memory_order_acquire); \
})

Determine if a thread loop should continue.

Parameters
ctrlThreadCtrl object reference.
countintegral lvalue, number of processed items in last iteration.
Return values
truethe thread should continue execution.
falsethe thread should stop.
Postcondition
count==0

Typedef Documentation

◆ ThreadCtrl

typedef struct ThreadCtrl ThreadCtrl

Thread load stats and stop flag.