示例#1
0
static void* DThread_Wrapper( void *p )
{
	DThread *self = (DThread*) p;
	if( self->thdSpecData == NULL ){
		self->thdSpecData = (DThreadData*)dao_calloc( 1, sizeof(DThreadData) );
		self->thdSpecData->thdObject = self;
	}
	self->thdSpecData->state = 0;
	pthread_setspecific( thdSpecKey, self->thdSpecData );

	if( self->cleaner ){
		pthread_cleanup_push( self->cleaner, self->taskArg );
		if( self->taskFunc ) self->taskFunc( self->taskArg );
		pthread_cleanup_pop( 1 );
	}else{
		if( self->taskFunc ) self->taskFunc( self->taskArg );
	}
	pthread_exit( 0 );
	return NULL;
}
示例#2
0
文件: daoThread.c 项目: daokoder/dao
static void* DThread_Wrapper( void *p )
{
	DThread *self = (DThread*) p;
	if( self->thdSpecData == NULL ){
		self->thdSpecData = DThreadData_New();
		self->thdSpecData->thdObject = self;
	}
	self->state = 0;
	self->vmpause = 0;
	self->vmpaused = 0;
	self->vmstop = 0;
	self->vmstopped = 0;

	if( self->cleaner ){
		pthread_cleanup_push( self->cleaner, self->taskArg );
		if( self->taskFunc ) self->taskFunc( self->taskArg );
		pthread_cleanup_pop( 1 );
	}else{
		if( self->taskFunc ) self->taskFunc( self->taskArg );
	}
	pthread_exit( 0 );
	return NULL;
}
示例#3
0
文件: daoThread.c 项目: hooloong/dao
void DThread_Wrapper( void *object )
{
	DThread *self = (DThread*)object;
	self->running = 1;

	if( self->thdSpecData == NULL ){
		self->thdSpecData = (DThreadData*)GlobalAlloc( GPTR, sizeof(DThreadData) );
		self->thdSpecData->thdObject = self;
	}
	self->thdSpecData->state = 0;
	TlsSetValue( thdSpecKey, self->thdSpecData );

	if( self->taskFunc ) self->taskFunc( self->taskArg );
	DThread_Exit( self );
}
示例#4
0
文件: daoThread.c 项目: daokoder/dao
void DThread_Wrapper( void *object )
{
	DThread *self = (DThread*)object;
	self->running = 1;

	if( self->thdSpecData == NULL ){
		self->thdSpecData = DThreadData_New();
		self->thdSpecData->thdObject = self;
	}
	self->state = 0;
	self->vmpause = 0;
	self->vmpaused = 0;
	self->vmstop = 0;
	self->vmstopped = 0;

	if( self->taskFunc ) self->taskFunc( self->taskArg );
	DThread_Exit( self );
}