Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 201412 | Differences between
and this patch

Collapse All | Expand All

(-)src-native-new/src/transport/BaseTransport/BaseTL.c (+2 lines)
Lines 172-177 Link Here
172
172
173
	/* Start the server thread for this TL */
173
	/* Start the server thread for this TL */
174
	tptpStartThread( processingFunc, (void*)stateData, &threadID, &threadHandle);
174
	tptpStartThread( processingFunc, (void*)stateData, &threadID, &threadHandle);
175
	CLOSE_TPTP_HANDLE(threadHandle);
175
176
176
	return 0;
177
	return 0;
177
}
178
}
Lines 503-508 Link Here
503
	HANDLE         threadHandle;
504
	HANDLE         threadHandle;
504
505
505
	tptpStartThread( commandTimeoutThread, (void*)contextData, &threadID, &threadHandle);
506
	tptpStartThread( commandTimeoutThread, (void*)contextData, &threadID, &threadHandle);
507
	CLOSE_TPTP_HANDLE(threadHandle);
506
}
508
}
507
509
508
/**
510
/**
(-)src-native-new/src/client/ConnectionImpl.cpp (+1 lines)
Lines 109-114 Link Here
109
109
110
	reader = new SocketReaderThread(this);
110
	reader = new SocketReaderThread(this);
111
	tptpStartThread(ConnectionImpl::SocketReaderThread::startThread, (LPVOID) &reader, &tid, &th);
111
	tptpStartThread(ConnectionImpl::SocketReaderThread::startThread, (LPVOID) &reader, &tid, &th);
112
	CLOSE_TPTP_HANDLE(th);
112
113
113
}
114
}
114
115
(-)src-native-new/src/client/TCPDataServer.cpp (+2 lines)
Lines 679-684 Link Here
679
		DWORD tid1;
679
		DWORD tid1;
680
680
681
		tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1);
681
		tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1);
682
		CLOSE_TPTP_HANDLE(th1);
682
683
683
		//HANDLE th2;
684
		//HANDLE th2;
684
		//DWORD tid2;
685
		//DWORD tid2;
Lines 702-707 Link Here
702
	DWORD tid1;
703
	DWORD tid1;
703
704
704
	tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1);
705
	tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1);
706
	CLOSE_TPTP_HANDLE(th1);
705
}
707
}
706
708
707
709
(-)src-native-new/src/transport/TPTPClientCompTL/nativeFileServer.c (+1 lines)
Lines 543-548 Link Here
543
		con->stateData = stateData;
543
		con->stateData = stateData;
544
	        
544
	        
545
	    tptpStartThread(processFSRequest, (LPVOID)con, &threadId, &threadHandle) ;
545
	    tptpStartThread(processFSRequest, (LPVOID)con, &threadId, &threadHandle) ;
546
		CLOSE_TPTP_HANDLE(threadHandle);
546
	}
547
	}
547
	
548
	
548
	closeSocket(serverSocket);
549
	closeSocket(serverSocket);
(-)src-native-new/src/transport/TPTPClientCompTL/java.c (-1 / +3 lines)
Lines 60-65 Link Here
60
60
61
tptp_uint32 tptpSubmitJavaJob(tl_state_data_t* stateData, tptpJavaJobImplementation *jobImpl, BOOL asynchronous, TID *tid) {
61
tptp_uint32 tptpSubmitJavaJob(tl_state_data_t* stateData, tptpJavaJobImplementation *jobImpl, BOOL asynchronous, TID *tid) {
62
    tptpJavaJobWrapper* ptr; /* the pointer to the wrapper for the function pointer */
62
    tptpJavaJobWrapper* ptr; /* the pointer to the wrapper for the function pointer */
63
	HANDLE handle;
63
	
64
	
64
					  /* On AS/400, function and variable pointers are not interchangable.  This wrapper is therefore needed
65
					  /* On AS/400, function and variable pointers are not interchangable.  This wrapper is therefore needed
65
					  to create threads properly. This pointer is dynamically allocated to avoid a race condition.  It is
66
					  to create threads properly. This pointer is dynamically allocated to avoid a race condition.  It is
Lines 71-82 Link Here
71
    if (asynchronous) {
72
    if (asynchronous) {
72
        /* Create a thread to run the job on */
73
        /* Create a thread to run the job on */
73
#ifdef _WIN32
74
#ifdef _WIN32
74
        CreateThread(NULL,              /* default security attributes */
75
        handle = CreateThread(NULL,              /* default security attributes */
75
			0,                 /* same stack size as current thread */
76
			0,                 /* same stack size as current thread */
76
			win32JavaJobProxy, /* Thread entry point */
77
			win32JavaJobProxy, /* Thread entry point */
77
			(LPVOID) ptr,      /* params */
78
			(LPVOID) ptr,      /* params */
78
			0,                 /* start executing immediately */
79
			0,                 /* start executing immediately */
79
			tid);              /* the thread ID */
80
			tid);              /* the thread ID */
81
		CLOSE_TPTP_HANDLE(handle);
80
#else
82
#else
81
        if (pthread_create(tid, NULL, JavaJob, ptr)) {
83
        if (pthread_create(tid, NULL, JavaJob, ptr)) {
82
            return -1;
84
            return -1;
(-)src-native-new/src/transport/TPTPClientCompTL/ClientCTL.c (-6 / +10 lines)
Lines 579-584 Link Here
579
579
580
	if ((!cctlData->isJavaUnsecuredFileServer) && !cctlData->securityEnabled) {
580
	if ((!cctlData->isJavaUnsecuredFileServer) && !cctlData->securityEnabled) {
581
		rc = tptpStartThread(startNativeFileServer, (LPVOID)stateData, &threadId, &threadHandle);
581
		rc = tptpStartThread(startNativeFileServer, (LPVOID)stateData, &threadId, &threadHandle);
582
		CLOSE_TPTP_HANDLE(threadHandle);
582
		if (rc == 0) {
583
		if (rc == 0) {
583
			TPTP_LOG_INFO_MSG1(stateData, "Native file server started listening on port %d", cctlData->filePort);
584
			TPTP_LOG_INFO_MSG1(stateData, "Native file server started listening on port %d", cctlData->filePort);
584
		}
585
		}
Lines 788-793 Link Here
788
		/* go create a new thread to process each incoming connection request */
789
		/* go create a new thread to process each incoming connection request */
789
		rc = tptpStartThread(processClientRequest, 
790
		rc = tptpStartThread(processClientRequest, 
790
			(LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
791
			(LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
792
		CLOSE_TPTP_HANDLE(threadHandle);
791
	}
793
	}
792
794
793
	return 0;
795
	return 0;
Lines 1004-1017 Link Here
1004
 */
1006
 */
1005
static TID startProcessPollingThread(tl_state_data_t* stateData) {
1007
static TID startProcessPollingThread(tl_state_data_t* stateData) {
1006
	TID tid;
1008
	TID tid;
1009
	HANDLE handle;
1007
	cctl_state_data_t* cctlData = (cctl_state_data_t*)stateData->implData;
1010
	cctl_state_data_t* cctlData = (cctl_state_data_t*)stateData->implData;
1008
#ifdef _WIN32
1011
#ifdef _WIN32
1009
	CreateThread(NULL,			/* default security attributes */
1012
	handle = CreateThread(NULL,			/* default security attributes */
1010
		0,						/* same stack size as current thread */
1013
						0,						/* same stack size as current thread */
1011
		processPollingThread,	/* thread entry point */
1014
						processPollingThread,	/* thread entry point */
1012
		(LPVOID)cctlData,		/* thread params */
1015
						(LPVOID)cctlData,		/* thread params */
1013
		0,						/* start executing immediately */
1016
						0,						/* start executing immediately */
1014
		&tid);					/* the thread ID */
1017
						&tid);					/* the thread ID */
1018
	CLOSE_TPTP_HANDLE(handle);
1015
#else
1019
#else
1016
	pthread_create(&tid,
1020
	pthread_create(&tid,
1017
		NULL,
1021
		NULL,
(-)src-native-new/src/transport/TPTPClientCompTL/CCTLServer.c (+1 lines)
Lines 556-561 Link Here
556
				/* go create a new thread to process each incoming connection request */
556
				/* go create a new thread to process each incoming connection request */
557
				rc = tptpStartThread(processClientRequest, 
557
				rc = tptpStartThread(processClientRequest, 
558
					(LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
558
					(LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
559
				CLOSE_TPTP_HANDLE(threadHandle);
559
			}
560
			}
560
		}
561
		}
561
	}
562
	}
(-)src-native-new/src/transport/TPTPClientCompTL/secureServer.c (+1 lines)
Lines 261-266 Link Here
261
261
262
	/* go create a new thread to process each incoming connection request */
262
	/* go create a new thread to process each incoming connection request */
263
	tptpStartThread(processJavaClientRequest, (LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
263
	tptpStartThread(processJavaClientRequest, (LPVOID)clientConnectionBlock, &threadId, &threadHandle) ;
264
	CLOSE_TPTP_HANDLE(threadHandle);
264
	TPTP_LOG_INFO_MSG(stateData, "Java client handling thread started");
265
	TPTP_LOG_INFO_MSG(stateData, "Java client handling thread started");
265
266
266
	return 0;
267
	return 0;
(-)src-native-new/src/transport/TPTPClientCompTL/Connect2AC.c (+1 lines)
Lines 1089-1094 Link Here
1089
		if (dataSock != -1) {
1089
		if (dataSock != -1) {
1090
			rc = tptpStartThread(processClientConsole, 
1090
			rc = tptpStartThread(processClientConsole, 
1091
				(LPVOID)cci, &threadId, &threadHandle) ;
1091
				(LPVOID)cci, &threadId, &threadHandle) ;
1092
			CLOSE_TPTP_HANDLE(threadHandle);
1092
		}
1093
		}
1093
		/* Success! */
1094
		/* Success! */
1094
		pid = startProcessContextData->processID;
1095
		pid = startProcessContextData->processID;
(-)src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c (+1 lines)
Lines 497-502 Link Here
497
497
498
498
499
	tptpStartThread(doFlushToFD, (LPVOID) connectionEntry, &threadId, &threadHandle);
499
	tptpStartThread(doFlushToFD, (LPVOID) connectionEntry, &threadId, &threadHandle);
500
	CLOSE_TPTP_HANDLE(threadHandle);
500
501
501
	return 0;
502
	return 0;
502
}
503
}
(-)src-native-new/src/transport/TPTPAgentCompTL/Connect2AC.c (-6 / +10 lines)
Lines 634-639 Link Here
634
	{
634
	{
635
		rc = tptpStartThread(doAgentListening, 
635
		rc = tptpStartThread(doAgentListening, 
636
				(LPVOID) pData, &threadId, &threadHandle);
636
				(LPVOID) pData, &threadId, &threadHandle);
637
		CLOSE_TPTP_HANDLE(threadHandle);
637
	}
638
	}
638
639
639
	sprintf( command, bindConnections, agent->agentID, AGENT_MANAGER,
640
	sprintf( command, bindConnections, agent->agentID, AGENT_MANAGER,
Lines 769-774 Link Here
769
	HANDLE         threadHandle;
770
	HANDLE         threadHandle;
770
771
771
	tptpStartThread( flushingTimeoutThread, (void*)agent, &threadID, &threadHandle);
772
	tptpStartThread( flushingTimeoutThread, (void*)agent, &threadID, &threadHandle);
773
	CLOSE_TPTP_HANDLE(threadHandle);
772
}
774
}
773
775
774
776
Lines 1341-1346 Link Here
1341
TID startProcessPurgeThread(tl_state_data_t* stateData) 
1343
TID startProcessPurgeThread(tl_state_data_t* stateData) 
1342
{
1344
{
1343
	TID                tid;
1345
	TID                tid;
1346
	HANDLE			   handle;
1344
	actl_state_data_t* actlData  = (actl_state_data_t*)stateData->implData;
1347
	actl_state_data_t* actlData  = (actl_state_data_t*)stateData->implData;
1345
1348
1346
	/* Get our wait mechanisms ready */
1349
	/* Get our wait mechanisms ready */
Lines 1349-1360 Link Here
1349
	actlData->agentInUse = 0;
1352
	actlData->agentInUse = 0;
1350
1353
1351
#ifdef _WIN32
1354
#ifdef _WIN32
1352
	CreateThread(NULL,			/* default security attributes */
1355
	handle = CreateThread(NULL,			/* default security attributes */
1353
		0,						/* same stack size as current thread */
1356
						0,						/* same stack size as current thread */
1354
		processPurgeThread,	    /* thread entry point */
1357
						processPurgeThread,	    /* thread entry point */
1355
		(LPVOID)stateData,		/* thread params */
1358
						(LPVOID)stateData,		/* thread params */
1356
		0,						/* start executing immediately */
1359
						0,						/* start executing immediately */
1357
		&tid);					/* the thread ID */
1360
						&tid);					/* the thread ID */
1361
	CLOSE_TPTP_HANDLE(handle);
1358
#else
1362
#else
1359
	pthread_create(&tid,
1363
	pthread_create(&tid,
1360
		NULL,
1364
		NULL,
(-)src-native-new/src/transport/socketTL/SocketListener.c (+5 lines)
Lines 702-707 Link Here
702
			/* go create a new thread to process each incoming connection request */
702
			/* go create a new thread to process each incoming connection request */
703
			rc = tptpStartThread(processClientRequest, 
703
			rc = tptpStartThread(processClientRequest, 
704
				(LPVOID) pRequestDataBlock, &threadId, &threadHandle) ;
704
				(LPVOID) pRequestDataBlock, &threadId, &threadHandle) ;
705
			CLOSE_TPTP_HANDLE(threadHandle);
705
706
706
		}
707
		}
707
	}
708
	}
Lines 741-746 Link Here
741
742
742
		/* go create a new thread to process each incoming connection request */
743
		/* go create a new thread to process each incoming connection request */
743
		rc = tptpStartThread(processClientRequest, (LPVOID) pRequestDataBlock, &threadId, &threadHandle);
744
		rc = tptpStartThread(processClientRequest, (LPVOID) pRequestDataBlock, &threadId, &threadHandle);
745
		CLOSE_TPTP_HANDLE(threadHandle);
744
	}
746
	}
745
747
746
	return rc;
748
	return rc;
Lines 944-952 Link Here
944
	if (pServerData->securityEnabled) {
946
	if (pServerData->securityEnabled) {
945
	 	if (ssl_init(pServerData)) return -1;
947
	 	if (ssl_init(pServerData)) return -1;
946
		rc = tptpStartThread(doSecureListening,(LPVOID) pServerData, &threadId, &threadHandle);
948
		rc = tptpStartThread(doSecureListening,(LPVOID) pServerData, &threadId, &threadHandle);
949
		CLOSE_TPTP_HANDLE(threadHandle);
947
	}
950
	}
948
	else {
951
	else {
949
		rc = tptpStartThread(doListening,(LPVOID) pServerData, &threadId, &threadHandle);
952
		rc = tptpStartThread(doListening,(LPVOID) pServerData, &threadId, &threadHandle);
953
		CLOSE_TPTP_HANDLE(threadHandle);
950
	}
954
	}
951
955
952
	return rc;
956
	return rc;
Lines 1201-1206 Link Here
1201
		/* go create a new thread to process each incoming connection request */
1205
		/* go create a new thread to process each incoming connection request */
1202
		rc = tptpStartThread(processClientRequest, 
1206
		rc = tptpStartThread(processClientRequest, 
1203
				(LPVOID) pRequestDataBlock, &threadId, &threadHandle) ;
1207
				(LPVOID) pRequestDataBlock, &threadId, &threadHandle) ;
1208
		CLOSE_TPTP_HANDLE(threadHandle);
1204
1209
1205
	
1210
	
1206
		TPTP_LOG_DEBUG_MSG(pServerData, "Socket: Creating peer connection.");
1211
		TPTP_LOG_DEBUG_MSG(pServerData, "Socket: Creating peer connection.");
(-)src-native-new/src/agents/agentBase/DataProviderImpl.cpp (+1 lines)
Lines 447-452 Link Here
447
		HANDLE    th ;
447
		HANDLE    th ;
448
448
449
		tptpStartThread(handleSharedMemMsg, (void *) dataConn, &tid, &th);
449
		tptpStartThread(handleSharedMemMsg, (void *) dataConn, &tid, &th);
450
		CLOSE_TPTP_HANDLE(th);
450
	}
451
	}
451
452
452
	return rc;
453
	return rc;
(-)src-native-new/src/agents/agentBase/BaseAgentImpl.cpp (-2 / +3 lines)
Lines 291-298 Link Here
291
{
291
{
292
	TPTP_HANDLE registerThreadHandle;
292
	TPTP_HANDLE registerThreadHandle;
293
	TID registerThreadID;
293
	TID registerThreadID;
294
	startNewThread(registerFunc, (void *) this, &registerThreadID, &registerThreadHandle);
294
	int status = startNewThread(registerFunc, (void *) this, &registerThreadID, &registerThreadHandle);
295
	return 0;
295
	CLOSE_TPTP_HANDLE(registerThreadHandle);
296
	return status;
296
}
297
}
297
298
298
// registerFunc register agent at AC.
299
// registerFunc register agent at AC.
(-)src-native-new/src/transport/sharedMemTL/SharedMemListener.c (+2 lines)
Lines 239-244 Link Here
239
		/* create new thread to listen to connection request */
239
		/* create new thread to listen to connection request */
240
		rc = tptpStartThread(doListening, 
240
		rc = tptpStartThread(doListening, 
241
				(LPVOID) pServerData, &threadId, &threadHandle) ;
241
				(LPVOID) pServerData, &threadId, &threadHandle) ;
242
		CLOSE_TPTP_HANDLE(threadHandle);
242
	}
243
	}
243
244
244
	return ( rc ) ;
245
	return ( rc ) ;
Lines 563-568 Link Here
563
	/* listening to the agent's incoming data */
564
	/* listening to the agent's incoming data */
564
	rc = tptpStartThread(processDataRequest, (LPVOID) pBlk,
565
	rc = tptpStartThread(processDataRequest, (LPVOID) pBlk,
565
			&threadId, &threadHandle) ;
566
			&threadId, &threadHandle) ;
567
	CLOSE_TPTP_HANDLE(threadHandle);
566
568
567
	/* Prepare the response command */
569
	/* Prepare the response command */
568
	/* Data connection complete contains: assigned connection id, uuid length & string */
570
	/* Data connection complete contains: assigned connection id, uuid length & string */
(-)src-native-new/src/transport/RACommon/java.c (-6 / +8 lines)
Lines 221-226 Link Here
221
221
222
int ra_submitJavaJobReuseJVMThread(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid, JNIEnv *jenv) {
222
int ra_submitJavaJobReuseJVMThread(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid, JNIEnv *jenv) {
223
	int rc = 0;
223
	int rc = 0;
224
	HANDLE handle;
224
#ifdef __OS400__
225
#ifdef __OS400__
225
    fcn_ptr_wrp* ptr; /* the pointer to the wrapper for the function pointer */
226
    fcn_ptr_wrp* ptr; /* the pointer to the wrapper for the function pointer */
226
227
Lines 241-252 Link Here
241
#endif
242
#endif
242
        /* Create a thread to run the job on */
243
        /* Create a thread to run the job on */
243
#ifdef _WIN32
244
#ifdef _WIN32
244
        CreateThread(NULL,              /* default security attributes */
245
        handle = CreateThread(NULL,              /* default security attributes */
245
                     0,                 /* same stack size as current thread */
246
							 0,                 /* same stack size as current thread */
246
                     win32JavaJobProxy, /* Thread entry point */
247
							 win32JavaJobProxy, /* Thread entry point */
247
                     (LPVOID) jobImpl,  /* params */
248
							 (LPVOID) jobImpl,  /* params */
248
                     0,                 /* start executing immediately */
249
							 0,                 /* start executing immediately */
249
                     tid);              /* the thread ID */
250
							 tid);              /* the thread ID */
251
		CloseHandle(handle);
250
#elif defined __OS400__
252
#elif defined __OS400__
251
        if (pthread_create(tid, NULL, JavaJob, ptr)) {
253
        if (pthread_create(tid, NULL, JavaJob, ptr)) {
252
#if _DEBUG
254
#if _DEBUG
(-)src-native-new/src/transport/namedPipeTL/NamedPipeListener.c (+3 lines)
Lines 263-268 Link Here
263
263
264
	rc = tptpStartThread(processConsoleRequest,
264
	rc = tptpStartThread(processConsoleRequest,
265
		(LPVOID) pThreadData, &threadId, &threadHandle) ;
265
		(LPVOID) pThreadData, &threadId, &threadHandle) ;
266
	CLOSE_TPTP_HANDLE(threadHandle);
266
267
267
268
268
	/* start thread to handle console stderr */
269
	/* start thread to handle console stderr */
Lines 273-278 Link Here
273
274
274
	rc = tptpStartThread(processConsoleRequest,
275
	rc = tptpStartThread(processConsoleRequest,
275
		(LPVOID) pThreadData, &threadId, &threadHandle) ;
276
		(LPVOID) pThreadData, &threadId, &threadHandle) ;
277
	CLOSE_TPTP_HANDLE(threadHandle);
276
278
277
279
278
	/* Open the write end of the console stdin named pipe.
280
	/* Open the write end of the console stdin named pipe.
Lines 1074-1079 Link Here
1074
	
1076
	
1075
		/* create new thread to listen to connection request */
1077
		/* create new thread to listen to connection request */
1076
		rc = tptpStartThread(doListening, (LPVOID)pServerData, &threadId, &threadHandle);
1078
		rc = tptpStartThread(doListening, (LPVOID)pServerData, &threadId, &threadHandle);
1079
		CLOSE_TPTP_HANDLE(threadHandle);
1077
1080
1078
		/* TODO: save the threadID and threadHandle? */
1081
		/* TODO: save the threadID and threadHandle? */
1079
	}
1082
	}
(-)src-native-new/src/transport/RASocket/RASocket.c (-12 / +16 lines)
Lines 133-138 Link Here
133
	struct sockaddr_in serverAddress;
133
	struct sockaddr_in serverAddress;
134
	char localhost[MAX_HOST_NAME_LENGTH+1];
134
	char localhost[MAX_HOST_NAME_LENGTH+1];
135
	struct linger linger;
135
	struct linger linger;
136
	HANDLE handle;
136
137
137
	BZERO(result, sizeof(result));
138
	BZERO(result, sizeof(result));
138
	BZERO(&serverAddress, sizeof(serverAddress));
139
	BZERO(&serverAddress, sizeof(serverAddress));
Lines 217-228 Link Here
217
		ra_setLastError(HANDLE_NO_INHERIT_FAILED, errno);
218
		ra_setLastError(HANDLE_NO_INHERIT_FAILED, errno);
218
		return -1;
219
		return -1;
219
	}
220
	}
220
	CreateThread(NULL,						/* default security attributes */
221
	handle = CreateThread(NULL,						/* default security attributes */
221
				 0,							/* same stack size as current thread */
222
						 0,							/* same stack size as current thread */
222
				 win32BoundUDPServerProxy,	/* Thread entry point */
223
						 win32BoundUDPServerProxy,	/* Thread entry point */
223
				 (LPVOID)result,			/* No params */
224
						 (LPVOID)result,			/* No params */
224
				 0,							/* start executing immediately */
225
						 0,							/* start executing immediately */
225
				 &(result->tid));			/* the thread ID */
226
						 &(result->tid));			/* the thread ID */
227
	CloseHandle(handle);
226
#else
228
#else
227
	errno=0;
229
	errno=0;
228
	if(pthread_create(&(result->tid),
230
	if(pthread_create(&(result->tid),
Lines 383-388 Link Here
383
int ra_createTCPServer(unsigned short portNum,
385
int ra_createTCPServer(unsigned short portNum,
384
					   ra_serverInfo_t *result) {
386
					   ra_serverInfo_t *result) {
385
387
388
	HANDLE handle;
386
#ifdef _WIN32
389
#ifdef _WIN32
387
	/* On WinDoze we have to initialize the sockets */
390
	/* On WinDoze we have to initialize the sockets */
388
	if(ra_win32InitializeSockets()<0) {
391
	if(ra_win32InitializeSockets()<0) {
Lines 392-403 Link Here
392
395
393
	/* Run the server on a separate thread and return the tid */
396
	/* Run the server on a separate thread and return the tid */
394
#ifdef _WIN32
397
#ifdef _WIN32
395
	CreateThread(NULL,					/* default security attributes */
398
	handle = CreateThread(NULL,					/* default security attributes */
396
				 0,						/* same stack size as current thread */
399
						 0,						/* same stack size as current thread */
397
				 win32TCPServerProxy,	/* Thread entry point */
400
						 win32TCPServerProxy,	/* Thread entry point */
398
				 (LPVOID)result,		/* params */
401
						 (LPVOID)result,		/* params */
399
				 0,						/* start executing immediately */
402
						 0,						/* start executing immediately */
400
				 &(result->tid));		/* the thread ID */
403
						 &(result->tid));		/* the thread ID */
404
	CloseHandle(handle);
401
#else
405
#else
402
	errno=0;
406
	errno=0;
403
	if(pthread_create(&(result->tid),
407
	if(pthread_create(&(result->tid),
(-)src-native-new/src/agents/thread/hcthread.c (-1 / +3 lines)
Lines 206-213 Link Here
206
 */
206
 */
207
void autodump(int interval) {
207
void autodump(int interval) {
208
	TID tid;
208
	TID tid;
209
	HANDLE handle;
209
#ifdef _WIN32
210
#ifdef _WIN32
210
	CreateThread(NULL, 0, autoDumpProxy, (LPVOID)(&interval), 0, &tid);
211
	handle = CreateThread(NULL, 0, autoDumpProxy, (LPVOID)(&interval), 0, &tid);
212
	CloseHandle(handle);
211
#else
213
#else
212
	pthread_create(&tid, NULL, autoDumpThread, &interval);
214
	pthread_create(&tid, NULL, autoDumpThread, &interval);
213
#endif
215
#endif
(-)src-native-new/samples/TimeCollector/TimeCollector.cpp (-6 / +7 lines)
Lines 146-157 Link Here
146
	// is not actually collecting anything - it just sends msgs over the data
146
	// is not actually collecting anything - it just sends msgs over the data
147
	// channel. 
147
	// channel. 
148
#ifdef _WIN32
148
#ifdef _WIN32
149
	CreateThread(NULL,                /* default security attributes       */
149
	HANDLE handle = CreateThread(NULL,                /* default security attributes       */
150
				 0,                   /* same stack size as current thread */
150
								 0,                   /* same stack size as current thread */
151
				 runThreadWin32,      /* Thread entry point                */
151
								 runThreadWin32,      /* Thread entry point                */
152
				 (LPVOID)this,        /* flusher info params               */
152
								 (LPVOID)this,        /* flusher info params               */
153
				 0,                   /* start executing immediately       */
153
								 0,                   /* start executing immediately       */
154
				 &tid );              /* the thread ID                     */
154
								 &tid );              /* the thread ID                     */
155
	CLOSE_TPTP_HANDLE(handle);
155
#else
156
#else
156
	pthread_create( &tid, NULL, runThreadNonWin32, (void *)this );
157
	pthread_create( &tid, NULL, runThreadNonWin32, (void *)this );
157
#endif
158
#endif

Return to bug 201412