Thread variable __thread use

#define MAX_CALLBACK_TYPE 100
static struct {
    
    
	char stu_type;
	int flags;
	void *callback;
} msg_callback[MAX_CALLBACK_TYPE] ;

The structure is initialized as above:

#define MAX_CALLBACK_TYPE 100
static struct {
    
    
	char stu_type;
	int flags;
	void *callback;
} msg_callback[MAX_CALLBACK_TYPE] = {
    
    {
    
    type_1, MALE, test_callback},} ;

Wrong initialization method:

msg_callback[0].stu_type = xxx;
msg_callback[0].flags = xxx;

Guess you like

Origin blog.csdn.net/sun172270102/article/details/109728486