Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 95518 Details for
Bug 201412
Repeated launch through Automated Services Framework eventually fails
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix broken NativeFileServer.c
org.eclipse.tptp.platform.agentcontroller_patch.txt (text/plain), 23.69 KB, created by
Stanislav Polevic
on 2008-04-10 09:04:14 EDT
(
hide
)
Description:
Fix broken NativeFileServer.c
Filename:
MIME Type:
Creator:
Stanislav Polevic
Created:
2008-04-10 09:04:14 EDT
Size:
23.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/transport/BaseTransport/BaseTL.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/BaseTransport/BaseTL.c,v >retrieving revision 1.13 >diff -u -r1.13 BaseTL.c >--- src-native-new/src/transport/BaseTransport/BaseTL.c 13 Apr 2007 16:06:44 -0000 1.13 >+++ src-native-new/src/transport/BaseTransport/BaseTL.c 10 Apr 2008 13:00:13 -0000 >@@ -172,6 +172,7 @@ > > /* Start the server thread for this TL */ > tptpStartThread( processingFunc, (void*)stateData, &threadID, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > > return 0; > } >@@ -503,6 +504,7 @@ > HANDLE threadHandle; > > tptpStartThread( commandTimeoutThread, (void*)contextData, &threadID, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > /** >Index: src-native-new/src/client/ConnectionImpl.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/client/ConnectionImpl.cpp,v >retrieving revision 1.28 >diff -u -r1.28 ConnectionImpl.cpp >--- src-native-new/src/client/ConnectionImpl.cpp 14 Jan 2008 11:16:48 -0000 1.28 >+++ src-native-new/src/client/ConnectionImpl.cpp 10 Apr 2008 13:00:12 -0000 >@@ -109,6 +109,7 @@ > > reader = new SocketReaderThread(this); > tptpStartThread(ConnectionImpl::SocketReaderThread::startThread, (LPVOID) &reader, &tid, &th); >+ CLOSE_TPTP_HANDLE(th); > > } > >Index: src-native-new/src/client/TCPDataServer.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/client/TCPDataServer.cpp,v >retrieving revision 1.22 >diff -u -r1.22 TCPDataServer.cpp >--- src-native-new/src/client/TCPDataServer.cpp 14 Jan 2008 11:16:48 -0000 1.22 >+++ src-native-new/src/client/TCPDataServer.cpp 10 Apr 2008 13:00:12 -0000 >@@ -679,6 +679,7 @@ > DWORD tid1; > > tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1); >+ CLOSE_TPTP_HANDLE(th1); > > //HANDLE th2; > //DWORD tid2; >@@ -702,6 +703,7 @@ > DWORD tid1; > > tptpStartThread(TCPDataServer::TCPDataProcessor::startThread, (LPVOID) _server, &tid1, &th1); >+ CLOSE_TPTP_HANDLE(th1); > } > > >Index: src-native-new/src/transport/TPTPClientCompTL/nativeFileServer.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/nativeFileServer.c,v >retrieving revision 1.4 >diff -u -r1.4 nativeFileServer.c >--- src-native-new/src/transport/TPTPClientCompTL/nativeFileServer.c 8 Apr 2008 13:58:35 -0000 1.4 >+++ src-native-new/src/transport/TPTPClientCompTL/nativeFileServer.c 10 Apr 2008 13:00:16 -0000 >@@ -543,6 +543,7 @@ > con->stateData = stateData; > > tptpStartThread(processFSRequest, (LPVOID)con, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > closeSocket(serverSocket); >Index: src-native-new/src/transport/TPTPClientCompTL/java.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/java.c,v >retrieving revision 1.3 >diff -u -r1.3 java.c >--- src-native-new/src/transport/TPTPClientCompTL/java.c 25 Jan 2008 10:47:07 -0000 1.3 >+++ src-native-new/src/transport/TPTPClientCompTL/java.c 10 Apr 2008 13:00:16 -0000 >@@ -60,6 +60,7 @@ > > tptp_uint32 tptpSubmitJavaJob(tl_state_data_t* stateData, tptpJavaJobImplementation *jobImpl, BOOL asynchronous, TID *tid) { > tptpJavaJobWrapper* ptr; /* the pointer to the wrapper for the function pointer */ >+ HANDLE handle; > > /* On AS/400, function and variable pointers are not interchangable. This wrapper is therefore needed > to create threads properly. This pointer is dynamically allocated to avoid a race condition. It is >@@ -71,12 +72,13 @@ > if (asynchronous) { > /* Create a thread to run the job on */ > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >+ handle = CreateThread(NULL, /* default security attributes */ > 0, /* same stack size as current thread */ > win32JavaJobProxy, /* Thread entry point */ > (LPVOID) ptr, /* params */ > 0, /* start executing immediately */ > tid); /* the thread ID */ >+ CLOSE_TPTP_HANDLE(handle); > #else > if (pthread_create(tid, NULL, JavaJob, ptr)) { > return -1; >Index: src-native-new/src/transport/TPTPClientCompTL/ClientCTL.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/ClientCTL.c,v >retrieving revision 1.47 >diff -u -r1.47 ClientCTL.c >--- src-native-new/src/transport/TPTPClientCompTL/ClientCTL.c 20 Mar 2008 15:22:46 -0000 1.47 >+++ src-native-new/src/transport/TPTPClientCompTL/ClientCTL.c 10 Apr 2008 13:00:15 -0000 >@@ -579,6 +579,7 @@ > > if ((!cctlData->isJavaUnsecuredFileServer) && !cctlData->securityEnabled) { > rc = tptpStartThread(startNativeFileServer, (LPVOID)stateData, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > if (rc == 0) { > TPTP_LOG_INFO_MSG1(stateData, "Native file server started listening on port %d", cctlData->filePort); > } >@@ -788,6 +789,7 @@ > /* go create a new thread to process each incoming connection request */ > rc = tptpStartThread(processClientRequest, > (LPVOID)clientConnectionBlock, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > return 0; >@@ -1004,14 +1006,16 @@ > */ > static TID startProcessPollingThread(tl_state_data_t* stateData) { > TID tid; >+ HANDLE handle; > cctl_state_data_t* cctlData = (cctl_state_data_t*)stateData->implData; > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- processPollingThread, /* thread entry point */ >- (LPVOID)cctlData, /* thread params */ >- 0, /* start executing immediately */ >- &tid); /* the thread ID */ >+ handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ processPollingThread, /* thread entry point */ >+ (LPVOID)cctlData, /* thread params */ >+ 0, /* start executing immediately */ >+ &tid); /* the thread ID */ >+ CLOSE_TPTP_HANDLE(handle); > #else > pthread_create(&tid, > NULL, >Index: src-native-new/src/transport/TPTPClientCompTL/CCTLServer.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/CCTLServer.c,v >retrieving revision 1.26 >diff -u -r1.26 CCTLServer.c >--- src-native-new/src/transport/TPTPClientCompTL/CCTLServer.c 21 Nov 2007 15:24:31 -0000 1.26 >+++ src-native-new/src/transport/TPTPClientCompTL/CCTLServer.c 10 Apr 2008 13:00:15 -0000 >@@ -556,6 +556,7 @@ > /* go create a new thread to process each incoming connection request */ > rc = tptpStartThread(processClientRequest, > (LPVOID)clientConnectionBlock, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > } > } > } >Index: src-native-new/src/transport/TPTPClientCompTL/secureServer.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/secureServer.c,v >retrieving revision 1.5 >diff -u -r1.5 secureServer.c >--- src-native-new/src/transport/TPTPClientCompTL/secureServer.c 13 Apr 2007 16:11:01 -0000 1.5 >+++ src-native-new/src/transport/TPTPClientCompTL/secureServer.c 10 Apr 2008 13:00:17 -0000 >@@ -261,6 +261,7 @@ > > /* go create a new thread to process each incoming connection request */ > tptpStartThread(processJavaClientRequest, (LPVOID)clientConnectionBlock, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > TPTP_LOG_INFO_MSG(stateData, "Java client handling thread started"); > > return 0; >Index: src-native-new/src/transport/TPTPClientCompTL/Connect2AC.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPClientCompTL/Connect2AC.c,v >retrieving revision 1.72 >diff -u -r1.72 Connect2AC.c >--- src-native-new/src/transport/TPTPClientCompTL/Connect2AC.c 14 Jan 2008 11:16:46 -0000 1.72 >+++ src-native-new/src/transport/TPTPClientCompTL/Connect2AC.c 10 Apr 2008 13:00:16 -0000 >@@ -1089,6 +1089,7 @@ > if (dataSock != -1) { > rc = tptpStartThread(processClientConsole, > (LPVOID)cci, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > } > /* Success! */ > pid = startProcessContextData->processID; >Index: src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c,v >retrieving revision 1.23 >diff -u -r1.23 AgentCTL.c >--- src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c 21 Nov 2007 16:16:49 -0000 1.23 >+++ src-native-new/src/transport/TPTPAgentCompTL/AgentCTL.c 10 Apr 2008 13:00:14 -0000 >@@ -497,6 +497,7 @@ > > > tptpStartThread(doFlushToFD, (LPVOID) connectionEntry, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > > return 0; > } >Index: src-native-new/src/transport/TPTPAgentCompTL/Connect2AC.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/TPTPAgentCompTL/Connect2AC.c,v >retrieving revision 1.57 >diff -u -r1.57 Connect2AC.c >--- src-native-new/src/transport/TPTPAgentCompTL/Connect2AC.c 21 Nov 2007 15:24:34 -0000 1.57 >+++ src-native-new/src/transport/TPTPAgentCompTL/Connect2AC.c 10 Apr 2008 13:00:14 -0000 >@@ -634,6 +634,7 @@ > { > rc = tptpStartThread(doAgentListening, > (LPVOID) pData, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > sprintf( command, bindConnections, agent->agentID, AGENT_MANAGER, >@@ -769,6 +770,7 @@ > HANDLE threadHandle; > > tptpStartThread( flushingTimeoutThread, (void*)agent, &threadID, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > >@@ -1341,6 +1343,7 @@ > TID startProcessPurgeThread(tl_state_data_t* stateData) > { > TID tid; >+ HANDLE handle; > actl_state_data_t* actlData = (actl_state_data_t*)stateData->implData; > > /* Get our wait mechanisms ready */ >@@ -1349,12 +1352,13 @@ > actlData->agentInUse = 0; > > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- processPurgeThread, /* thread entry point */ >- (LPVOID)stateData, /* thread params */ >- 0, /* start executing immediately */ >- &tid); /* the thread ID */ >+ handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ processPurgeThread, /* thread entry point */ >+ (LPVOID)stateData, /* thread params */ >+ 0, /* start executing immediately */ >+ &tid); /* the thread ID */ >+ CLOSE_TPTP_HANDLE(handle); > #else > pthread_create(&tid, > NULL, >Index: src-native-new/src/transport/socketTL/SocketListener.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/socketTL/SocketListener.c,v >retrieving revision 1.47 >diff -u -r1.47 SocketListener.c >--- src-native-new/src/transport/socketTL/SocketListener.c 7 Apr 2008 06:16:38 -0000 1.47 >+++ src-native-new/src/transport/socketTL/SocketListener.c 10 Apr 2008 13:00:18 -0000 >@@ -702,6 +702,7 @@ > /* go create a new thread to process each incoming connection request */ > rc = tptpStartThread(processClientRequest, > (LPVOID) pRequestDataBlock, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > > } > } >@@ -741,6 +742,7 @@ > > /* go create a new thread to process each incoming connection request */ > rc = tptpStartThread(processClientRequest, (LPVOID) pRequestDataBlock, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > return rc; >@@ -944,9 +946,11 @@ > if (pServerData->securityEnabled) { > if (ssl_init(pServerData)) return -1; > rc = tptpStartThread(doSecureListening,(LPVOID) pServerData, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > else { > rc = tptpStartThread(doListening,(LPVOID) pServerData, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > return rc; >@@ -1201,6 +1205,7 @@ > /* go create a new thread to process each incoming connection request */ > rc = tptpStartThread(processClientRequest, > (LPVOID) pRequestDataBlock, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > > > TPTP_LOG_DEBUG_MSG(pServerData, "Socket: Creating peer connection."); >Index: src-native-new/src/agents/agentBase/DataProviderImpl.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/agentBase/DataProviderImpl.cpp,v >retrieving revision 1.36 >diff -u -r1.36 DataProviderImpl.cpp >--- src-native-new/src/agents/agentBase/DataProviderImpl.cpp 11 Jan 2008 16:44:19 -0000 1.36 >+++ src-native-new/src/agents/agentBase/DataProviderImpl.cpp 10 Apr 2008 13:00:12 -0000 >@@ -447,6 +447,7 @@ > HANDLE th ; > > tptpStartThread(handleSharedMemMsg, (void *) dataConn, &tid, &th); >+ CLOSE_TPTP_HANDLE(th); > } > > return rc; >Index: src-native-new/src/agents/agentBase/BaseAgentImpl.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/agentBase/BaseAgentImpl.cpp,v >retrieving revision 1.69 >diff -u -r1.69 BaseAgentImpl.cpp >--- src-native-new/src/agents/agentBase/BaseAgentImpl.cpp 5 Feb 2008 16:36:22 -0000 1.69 >+++ src-native-new/src/agents/agentBase/BaseAgentImpl.cpp 10 Apr 2008 13:00:11 -0000 >@@ -291,8 +291,9 @@ > { > TPTP_HANDLE registerThreadHandle; > TID registerThreadID; >- startNewThread(registerFunc, (void *) this, ®isterThreadID, ®isterThreadHandle); >- return 0; >+ int status = startNewThread(registerFunc, (void *) this, ®isterThreadID, ®isterThreadHandle); >+ CLOSE_TPTP_HANDLE(registerThreadHandle); >+ return status; > } > > // registerFunc register agent at AC. >Index: src-native-new/src/transport/sharedMemTL/SharedMemListener.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/sharedMemTL/SharedMemListener.c,v >retrieving revision 1.34 >diff -u -r1.34 SharedMemListener.c >--- src-native-new/src/transport/sharedMemTL/SharedMemListener.c 21 Nov 2007 15:24:34 -0000 1.34 >+++ src-native-new/src/transport/sharedMemTL/SharedMemListener.c 10 Apr 2008 13:00:18 -0000 >@@ -239,6 +239,7 @@ > /* create new thread to listen to connection request */ > rc = tptpStartThread(doListening, > (LPVOID) pServerData, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > } > > return ( rc ) ; >@@ -563,6 +564,7 @@ > /* listening to the agent's incoming data */ > rc = tptpStartThread(processDataRequest, (LPVOID) pBlk, > &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > > /* Prepare the response command */ > /* Data connection complete contains: assigned connection id, uuid length & string */ >Index: src-native-new/src/transport/RACommon/java.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RACommon/java.c,v >retrieving revision 1.3 >diff -u -r1.3 java.c >--- src-native-new/src/transport/RACommon/java.c 19 Mar 2007 03:14:38 -0000 1.3 >+++ src-native-new/src/transport/RACommon/java.c 10 Apr 2008 13:00:13 -0000 >@@ -221,6 +221,7 @@ > > int ra_submitJavaJobReuseJVMThread(ra_javaJobImplementation *jobImpl, BOOL asynchronous, TID *tid, JNIEnv *jenv) { > int rc = 0; >+ HANDLE handle; > #ifdef __OS400__ > fcn_ptr_wrp* ptr; /* the pointer to the wrapper for the function pointer */ > >@@ -241,12 +242,13 @@ > #endif > /* Create a thread to run the job on */ > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- win32JavaJobProxy, /* Thread entry point */ >- (LPVOID) jobImpl, /* params */ >- 0, /* start executing immediately */ >- tid); /* the thread ID */ >+ handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32JavaJobProxy, /* Thread entry point */ >+ (LPVOID) jobImpl, /* params */ >+ 0, /* start executing immediately */ >+ tid); /* the thread ID */ >+ CloseHandle(handle); > #elif defined __OS400__ > if (pthread_create(tid, NULL, JavaJob, ptr)) { > #if _DEBUG >Index: src-native-new/src/transport/namedPipeTL/NamedPipeListener.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/namedPipeTL/NamedPipeListener.c,v >retrieving revision 1.51 >diff -u -r1.51 NamedPipeListener.c >--- src-native-new/src/transport/namedPipeTL/NamedPipeListener.c 8 Apr 2008 06:50:48 -0000 1.51 >+++ src-native-new/src/transport/namedPipeTL/NamedPipeListener.c 10 Apr 2008 13:00:17 -0000 >@@ -263,6 +263,7 @@ > > rc = tptpStartThread(processConsoleRequest, > (LPVOID) pThreadData, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > > > /* start thread to handle console stderr */ >@@ -273,6 +274,7 @@ > > rc = tptpStartThread(processConsoleRequest, > (LPVOID) pThreadData, &threadId, &threadHandle) ; >+ CLOSE_TPTP_HANDLE(threadHandle); > > > /* Open the write end of the console stdin named pipe. >@@ -1074,6 +1076,7 @@ > > /* create new thread to listen to connection request */ > rc = tptpStartThread(doListening, (LPVOID)pServerData, &threadId, &threadHandle); >+ CLOSE_TPTP_HANDLE(threadHandle); > > /* TODO: save the threadID and threadHandle? */ > } >Index: src-native-new/src/transport/RASocket/RASocket.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/transport/RASocket/RASocket.c,v >retrieving revision 1.4 >diff -u -r1.4 RASocket.c >--- src-native-new/src/transport/RASocket/RASocket.c 19 Mar 2007 03:14:37 -0000 1.4 >+++ src-native-new/src/transport/RASocket/RASocket.c 10 Apr 2008 13:00:13 -0000 >@@ -133,6 +133,7 @@ > struct sockaddr_in serverAddress; > char localhost[MAX_HOST_NAME_LENGTH+1]; > struct linger linger; >+ HANDLE handle; > > BZERO(result, sizeof(result)); > BZERO(&serverAddress, sizeof(serverAddress)); >@@ -217,12 +218,13 @@ > ra_setLastError(HANDLE_NO_INHERIT_FAILED, errno); > return -1; > } >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- win32BoundUDPServerProxy, /* Thread entry point */ >- (LPVOID)result, /* No params */ >- 0, /* start executing immediately */ >- &(result->tid)); /* the thread ID */ >+ handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32BoundUDPServerProxy, /* Thread entry point */ >+ (LPVOID)result, /* No params */ >+ 0, /* start executing immediately */ >+ &(result->tid)); /* the thread ID */ >+ CloseHandle(handle); > #else > errno=0; > if(pthread_create(&(result->tid), >@@ -383,6 +385,7 @@ > int ra_createTCPServer(unsigned short portNum, > ra_serverInfo_t *result) { > >+ HANDLE handle; > #ifdef _WIN32 > /* On WinDoze we have to initialize the sockets */ > if(ra_win32InitializeSockets()<0) { >@@ -392,12 +395,13 @@ > > /* Run the server on a separate thread and return the tid */ > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- win32TCPServerProxy, /* Thread entry point */ >- (LPVOID)result, /* params */ >- 0, /* start executing immediately */ >- &(result->tid)); /* the thread ID */ >+ handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ win32TCPServerProxy, /* Thread entry point */ >+ (LPVOID)result, /* params */ >+ 0, /* start executing immediately */ >+ &(result->tid)); /* the thread ID */ >+ CloseHandle(handle); > #else > errno=0; > if(pthread_create(&(result->tid), >Index: src-native-new/src/agents/thread/hcthread.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/thread/hcthread.c,v >retrieving revision 1.2 >diff -u -r1.2 hcthread.c >--- src-native-new/src/agents/thread/hcthread.c 6 Apr 2007 01:28:08 -0000 1.2 >+++ src-native-new/src/agents/thread/hcthread.c 10 Apr 2008 13:00:12 -0000 >@@ -206,8 +206,10 @@ > */ > void autodump(int interval) { > TID tid; >+ HANDLE handle; > #ifdef _WIN32 >- CreateThread(NULL, 0, autoDumpProxy, (LPVOID)(&interval), 0, &tid); >+ handle = CreateThread(NULL, 0, autoDumpProxy, (LPVOID)(&interval), 0, &tid); >+ CloseHandle(handle); > #else > pthread_create(&tid, NULL, autoDumpThread, &interval); > #endif >Index: src-native-new/samples/TimeCollector/TimeCollector.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/samples/TimeCollector/TimeCollector.cpp,v >retrieving revision 1.13 >diff -u -r1.13 TimeCollector.cpp >--- src-native-new/samples/TimeCollector/TimeCollector.cpp 1 May 2006 23:20:10 -0000 1.13 >+++ src-native-new/samples/TimeCollector/TimeCollector.cpp 10 Apr 2008 13:00:11 -0000 >@@ -146,12 +146,13 @@ > // is not actually collecting anything - it just sends msgs over the data > // channel. > #ifdef _WIN32 >- CreateThread(NULL, /* default security attributes */ >- 0, /* same stack size as current thread */ >- runThreadWin32, /* Thread entry point */ >- (LPVOID)this, /* flusher info params */ >- 0, /* start executing immediately */ >- &tid ); /* the thread ID */ >+ HANDLE handle = CreateThread(NULL, /* default security attributes */ >+ 0, /* same stack size as current thread */ >+ runThreadWin32, /* Thread entry point */ >+ (LPVOID)this, /* flusher info params */ >+ 0, /* start executing immediately */ >+ &tid ); /* the thread ID */ >+ CLOSE_TPTP_HANDLE(handle); > #else > pthread_create( &tid, NULL, runThreadNonWin32, (void *)this ); > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 201412
:
90772
|
90923
|
91870
|
95510
| 95518