代码拉取完成,页面将自动刷新
#ifndef _TIMER_H
#define _TIMER_H
#include "thread_pool.h"
#define TIME_NUM 60
struct node{
int uid; // 用户id
int peerfd; // 连接
struct node* next;
};
struct slot{
int size; // 结点的连接个数
struct node* head; // 结点链表
};
typedef struct time_queue{
struct slot slot[TIME_NUM]; // 循环队列
int current_index; // 当前指针
}Time_Queue;
Time_Queue* time_queue_init();
void time_queue_destroy(Time_Queue* queue);
void move_next(Time_Queue* queue);
void update_node(Time_Queue* queue, int uid, int peerfd);
void insert_node(Time_Queue* queue, int uid, int peerfd);
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。