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 173319 | Differences between
and this patch

Collapse All | Expand All

(-)src-native-new/src/transport/sharedMemTL/SharedMemListener.c (-8 / +36 lines)
Lines 71-77 Link Here
71
enum ThreadStatus { IDLE, RUNNING } ;
71
enum ThreadStatus { IDLE, RUNNING } ;
72
72
73
static int acShmMemCount = 0;
73
static int acShmMemCount = 0;
74
static int shMemInitialized = 0;
74
75
76
void destroyMem (mem_map_block_ptr_t  pMemBlockInfo);
77
78
extern void ossSleep (long ms);
75
79
76
/*====================================================================*/
80
/*====================================================================*/
77
/*    internal function prototypes                                    */
81
/*    internal function prototypes                                    */
Lines 224-233 Link Here
224
	else
228
	else
225
	{
229
	{
226
		pServerData->serverMemInfo = memBlockInfo ;
230
		pServerData->serverMemInfo = memBlockInfo ;
231
		shMemInitialized = 1;
227
		
232
		
228
		/* attach to this block so that it will not be deleted */
229
		ipcMemOpen(pServerData->sharedMemName, &memBlockInfo);
230
	
231
		/* create new thread to listen to connection request */
233
		/* create new thread to listen to connection request */
232
		rc = startNewThread(doListening, 
234
		rc = startNewThread(doListening, 
233
				(LPVOID) pServerData, &threadId, &threadHandle) ;
235
				(LPVOID) pServerData, &threadId, &threadHandle) ;
Lines 250-260 Link Here
250
252
251
tptp_int32   stopSharedMemListener(server_block_t* pServerData)
253
tptp_int32   stopSharedMemListener(server_block_t* pServerData)
252
{
254
{
255
	int cnt;
256
	
253
	pServerData->threadStatus = IDLE ;
257
	pServerData->threadStatus = IDLE ;
258
	ipcStopFlusher (&pServerData->serverMemInfo);
254
259
260
	cnt = 20;
261
	while (shMemInitialized && cnt-- > 0) {	// wait 2 sec for flusher termination
262
		ossSleep (100L);	
263
	} 
264
	
265
	if (shMemInitialized) {
266
		destroyMem (&pServerData->serverMemInfo);
267
	}
268
	
255
	return 0 ;
269
	return 0 ;
256
}
270
}
257
271
272
/**
273
 *********************************************************
274
 *
275
 * @brief
276
 *    destroy shared memory block
277
 *
278
 *********************************************************/
279
280
void destroyMem (mem_map_block_ptr_t  pMemBlockInfo) {
281
	ipcStopFlushing (pMemBlockInfo); // let shared memory get deleted when it is destroyed
282
	ipcMemDestroy (pMemBlockInfo);
283
	shMemInitialized = 0;
284
}
285
258
286
259
/**
287
/**
260
 *********************************************************
288
 *********************************************************
Lines 321-328 Link Here
321
	return 0 ;
349
	return 0 ;
322
}
350
}
323
351
324
325
326
/**
352
/**
327
 *********************************************************
353
 *********************************************************
328
 *
354
 *
Lines 376-388 Link Here
376
402
377
	while (pServerData->threadStatus == RUNNING)
403
	while (pServerData->threadStatus == RUNNING)
378
	{
404
	{
405
		/* attach to this block so that it will not be deleted */
406
		ipcMemOpen(pServerData->sharedMemName, pMemBlockInfo);
407
	
379
	    rc =  ipcFlushToFunc(pMemBlockInfo, sharedMemMainDataProcessorFunc, (void *) pServerData) ;
408
	    rc =  ipcFlushToFunc(pMemBlockInfo, sharedMemMainDataProcessorFunc, (void *) pServerData) ;
380
	    ipcMemOpen(pServerData->sharedMemName, pMemBlockInfo);
409
   	}
381
    	}
382
410
383
	TPTP_LOG_DEBUG_MSG(pServerData, "Shared memory server ends...\n") ;
411
	TPTP_LOG_DEBUG_MSG(pServerData, "Shared memory server ends...\n") ;
384
412
385
	ipcMemDestroy(pMemBlockInfo);
413
	destroyMem (pMemBlockInfo);
386
414
387
	return ( rc ) ;
415
	return ( rc ) ;
388
}
416
}
(-)src-native-new/src/transport/sharedMemTL/SharedMemTL.dsp (-1 / +1 lines)
Lines 80-86 Link Here
80
# ADD BSC32 /nologo
80
# ADD BSC32 /nologo
81
LINK32=link.exe
81
LINK32=link.exe
82
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
82
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
83
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib transportSupport.lib tptpUtils.lib /nologo /dll /debug /machine:I386 /def:".\sharedMemTL.def" /implib:"../../../lib/sharedMemTL.lib" /pdbtype:sept /libpath:"../../../lib"
83
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib transportSupport.lib tptpUtils.lib hcclsm.lib /nologo /dll /debug /machine:I386 /def:".\sharedMemTL.def" /implib:"../../../lib/sharedMemTL.lib" /pdbtype:sept /libpath:"../../../lib"
84
# SUBTRACT LINK32 /pdb:none
84
# SUBTRACT LINK32 /pdb:none
85
85
86
!ENDIF 
86
!ENDIF 
(-)src-native-new/src/transport/transportSupport/TransportSupport.def (-1 / +2 lines)
Lines 48-51 Link Here
48
	getPeerIPString				      @45
48
	getPeerIPString				      @45
49
	convertIPAddressUlongToString     @46
49
	convertIPAddressUlongToString     @46
50
	getSocketPort                     @47
50
	getSocketPort                     @47
51
	
51
	ipcStopFlusher                    @48
52
(-)src-native-new/src/transport/transportSupport/TransportSupportSharedMemExt.c (+13 lines)
Lines 25-30 Link Here
25
25
26
//We need to reference this stop flushing routine.
26
//We need to reference this stop flushing routine.
27
extern tptp_int32 ra_setShmAttachCount(ra_shm_handle_t *, tptp_int32);
27
extern tptp_int32 ra_setShmAttachCount(ra_shm_handle_t *, tptp_int32);
28
extern tptp_int32 ra_stopFlusher(ra_shm_handle_t *);
28
29
29
/**
30
/**
30
 *********************************************************
31
 *********************************************************
Lines 97-100 Link Here
97
	return ( rc ) ;
98
	return ( rc ) ;
98
}
99
}
99
100
101
int ipcStopFlusher(mem_map_block_ptr_t pBlockInfo)
102
{
103
	int    rc = 0 ;
104
105
	ra_shm_handle_t *pShmHdl = (ra_shm_handle_t *) pBlockInfo->pRamboBlock ;
106
107
	if (pShmHdl != NULL) {
108
		rc = ra_stopFlusher(pShmHdl);
109
	}
110
111
	return ( rc ) ;
112
}
100
113
(-)src-native-new/include/tptp/TransportSupportSharedMem.h (-2 / +1 lines)
Lines 239-244 Link Here
239
 *********************************************************/
239
 *********************************************************/
240
240
241
int ipcStopFlushing(mem_map_block_ptr_t pBlockInfo);
241
int ipcStopFlushing(mem_map_block_ptr_t pBlockInfo);
242
int ipcStopFlusher(mem_map_block_ptr_t pBlockInfo);
242
243
243
244
244
#ifdef __cplusplus
245
#ifdef __cplusplus
Lines 247-251 Link Here
247
248
248
249
249
#endif
250
#endif
250
251

Return to bug 173319