- 论坛徽章:
- 11
|
本帖最后由 zylthinking 于 2016-01-12 09:54 编辑
谁能告诉我这个函数里面有谁在 if(send_conn==NULL)return -1; 通过后,能够将局部变量 send_conn 置为 NULL
int TEngine::Base_Client_Lock(Conn *send_conn,const char* command,int size, int is_zip)
{
if(send_conn==NULL)return -1;
pthread_mutex_lock(&send_conn->UserCMDLock);
if(send_conn==NULL)
return -1;
if(send_conn->is_down==1){
pthread_mutex_unlock(&send_conn->UserCMDLock);
return -1;
}
int mid=proto->MODLUE_ID<0?proto->MODLUE_ID:9999999;
if (Client_BuildPact(mid,m_sbuff, command,size, is_zip) == -1)
{
pthread_mutex_unlock(&send_conn->UserCMDLock);
return -1;
}
socket_send(send_conn, m_sbuff->buff,m_sbuff->data_size);
pthread_mutex_unlock(&send_conn->UserCMDLock);
return 0;
} |
|