26,27:error: expected constructor, destructor, or type conversion before ‘('toke
小小的森林 2017-03-22 05:23:41 26,27:error: expected constructor, destructor, or type conversion before ‘('toke
pthread_mutex_lock (&mutex);
代码部分:
#include "test.hpp"
#include "stub.hpp"
stMsgQueue* wstBtaMsgQue = NULL;
stMsgQueue* wstHftMsgQue = NULL;
//pPairedDevInfLsN wstPairedDevInfLsN_p;
//PairedDevInfLsN wstPairedDevInfLsN_Next;
//Type_uWord ConHFTDeviceID=0;
static Type_uHWord nuhCnnCount = 0;
static Type_uHWord uwModuleID[IPC_CONNECT_COUNT];
static pthread_mutex_t cnn_lock;
//static Type_uHWord cnn_lock;
pthread_mutex_lock (&mutex); //这两行出错
pthread_mutex_unlock (&mutex); //26,27行
static Type_uHWord mutex;
Type_sHWord put_connect_info(Type_uWord module_id)
{
//AFW_LOG(btapp_log,AFW_LOG_LEVEL_DEBUG,AFW_LOG_STRING("[BTApp IPC]put_connect_info called"));
Type_Bool is_md_exsit = FALSE;
Type_uHWord i = 0;
if(nuhCnnCount >= IPC_CONNECT_COUNT)
return CNN_RET_ERR;
pthread_mutex_lock(&cnn_lock);
for(i = 0; i < nuhCnnCount;i++)
{
if(module_id == uwModuleID[i])
{
is_md_exsit = TRUE;
break;
}
}
if(!is_md_exsit)
{
uwModuleID[nuhCnnCount] = module_id;
nuhCnnCount++;
}else{
pthread_mutex_unlock(&cnn_lock);
return CNN_RET_EXSIT;
}
pthread_mutex_unlock(&cnn_lock);
return CNN_RET_OK;
}