when it encounters certain conditions like failures */
uint8_t aof;
- /** the type of thread as defined in tm-threads.h (TVT_PPT, TVT_MGMT) */
- uint8_t type;
-
/** no of times the thread has been restarted on failure */
uint8_t restarted;
+ /** local id */
+ int id;
+
/** queue's */
Tmq *inq;
Tmq *outq;
struct TmSlot_ *tm_slots;
uint8_t thread_setup_flags;
+
+ /** the type of thread as defined in tm-threads.h (TVT_PPT, TVT_MGMT) */
+ uint8_t type;
+
uint16_t cpu_affinity; /** cpu or core number to set affinity to */
int thread_priority; /** priority (real time) for this thread. Look at threads.h */
* thread encounters a failure. Defaults to restart the failed thread */
uint8_t tv_aof = THV_RESTART_THREAD;
+/** Counter for number of threadvar structs, so the number of threads we
+ * have. */
+int g_threadvars_cnt = 0;
+
/**
* \brief Check if a thread flag is set.
*
SC_ATOMIC_INIT(tv->flags);
SCMutexInit(&tv->sc_perf_pctx.m, NULL);
+ tv->id = g_threadvars_cnt++;
tv->name = name;
/* default state for every newly created thread */
TmThreadsSetFlag(tv, THV_PAUSE);
TmThreadWaitForFlag(tv, THV_INIT_DONE | THV_RUNNING_DONE);
TmThreadAppend(tv, tv->type);
-
return TM_ECODE_OK;
}