Mysql源码学习笔记——偷窥线程(4)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-20 07:54 点击:次
pthread_mutex_unlock(&THR_LOCK_thread);
if (hThread == (HANDLE) -1)
{
int error=errno;
DBUG_PRINT("error",
("Can't create thread to handle request (error %d)",error));
DBUG_RETURN(error ? error : -1);
}
VOID(SetThreadPriority(hThread, attr->priority)) ;
DBUG_RETURN(0);
}
关键的代码是下面三句:
map->func=func;
map->param=param;
_beginthread((void( __cdecl *)(void *)) pthread_start,
attr->dwStackSize ? attr->dwStackSize :
65535, (void*) map);
相关新闻>>
- 发表评论
-
- 最新评论 进入详细评论页>>