- 论坛徽章:
- 0
|
源代码如下:
void* COCIConnPool::thMaintain( void* pParam )
{
COCIConnPool* pObj= (COCIConnPool*)pParam; //对象指针
unsigned int iCount= 0;
pthread_detach( pthread_self() );
printf( "COCIConnPool maintain thread [%d:%d] start up !\n", (INT32)getpid(), (INT32)pthread_self() );
while ( pObj->m_cInitFlag )
{
usleep( 500 );
iCount++;
if ( iCount % 20 == 0 ) //10秒钟做一次维护操作
{
pObj->MaintianConnection();
}
}//while ( !pObj->m_cInitFlag )
printf( "COCIConnPool maintain thread [%d:%d] exit !\n", (INT32)getpid(), (INT32)pthread_self() );
return 0;
}
编译的时候报:
OCIConnPool.cpp: In function `static void * COCIConnPool::thMaintain(void *)':
OCIConnPool.cpp:321: invalid use of type decl `class COCIConnPool' as expression
OCIConnPool.cpp:321: `pObj' undeclared (first use this function)
OCIConnPool.cpp:321: (Each undeclared identifier is reported only once
OCIConnPool.cpp:321: for each function it appears in.)
OCIConnPool.cpp:321: invalid use of type decl `class COCIConnPool' as expression
OCIConnPool.cpp:321: parse error before `)'
不解为什么会报这个错误.
gcc 2.95.3 |
|