typedef struct _task_t {
    int conn_sock;			//客户连接socket
    int hit;                           //第几个客户
} task_t;

typedef struct {
    task_t *taskp;         /* Buffer array */         
    int cnt;            /* Maximum number of cell */
    int inpos;          /* buf[inpos] is first available cell */
    int outpos;         /* buf[outpos] is fist item */
    sem_t mutex;      /* Protects accesses to socks */
    sem_t avail;       /* Counts available cells */
    sem_t ready;      /* Counts ready items */
} task_line_t;

/*  task line wrapper functions */
void task_line_init(task_line_t *tlp, int n);
void task_line_deinit(task_line_t *tlp);
void task_insert(task_line_t *tlp, task_t item);
task_t task_remove(task_line_t *tlp);
