kinetic-c  v0.12.0
Seagate Kinetic Protocol Client Library for C
Data Structures | Macros | Enumerations
threadpool_internals.h File Reference
#include <pthread.h>
#include "threadpool.h"

Go to the source code of this file.

Data Structures

struct  thread_info
 Info retained by a thread while working. More...
 
struct  thread_context
 Thread_info, plus pointer back to main threadpool manager. More...
 
struct  marked_task
 A task, with an additional mark. More...
 
struct  threadpool
 Internal threadpool state. More...
 

Macros

#define ATOMIC_BOOL_COMPARE_AND_SWAP(PTR, OLD, NEW)   (__sync_bool_compare_and_swap(PTR, OLD, NEW))
 
#define NOTIFY_MSG   "!"
 
#define NOTIFY_MSG_LEN   1
 
#define SPIN_ADJ(F, ADJ)
 

Enumerations

enum  thread_status_t
 Current status of a worker thread. More...
 

Macro Definition Documentation

#define ATOMIC_BOOL_COMPARE_AND_SWAP (   PTR,
  OLD,
  NEW 
)    (__sync_bool_compare_and_swap(PTR, OLD, NEW))

Definition at line 90 of file threadpool_internals.h.

#define NOTIFY_MSG   "!"

Definition at line 94 of file threadpool_internals.h.

#define NOTIFY_MSG_LEN   1

Definition at line 95 of file threadpool_internals.h.

#define SPIN_ADJ (   F,
  ADJ 
)
Value:
do { \
for (;;) { \
size_t v = F; \
if (ATOMIC_BOOL_COMPARE_AND_SWAP(&F, v, v + ADJ)) { \
break; \
} \
} \
} while (0)
#define ATOMIC_BOOL_COMPARE_AND_SWAP(PTR, OLD, NEW)

Definition at line 98 of file threadpool_internals.h.

Enumeration Type Documentation

Current status of a worker thread.

Enumerator
STATUS_NONE 
STATUS_ASLEEP 
STATUS_AWAKE 
STATUS_SHUTDOWN 
STATUS_JOINED 

Definition at line 27 of file threadpool_internals.h.