From: Tyrel D. <ty...@us...> - 2010-12-21 02:48:17
|
Update of /cvsroot/sblim/cmpi-base In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv4988 Modified Files: NEWS OSBase_Processor.c OSBase_Processor.h cmpiOSBase_ProcessorProvider.c Log Message: Fixed 2610775: ProcessorProvider crashes on exit Index: NEWS =================================================================== RCS file: /cvsroot/sblim/cmpi-base/NEWS,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- NEWS 21 Dec 2010 02:44:26 -0000 1.40 +++ NEWS 21 Dec 2010 02:48:09 -0000 1.41 @@ -2,6 +2,7 @@ - 2843613 Missing fclose in sblim-cmpi-base - 2882514 leak in sblim-cmpi-base-1.5.9/cmpiOSBase_OperatingSystem.c - 2836926 _osbase_common_init unreliable +- 2610775 ProcessorProvider crashes on exit Changes in Version 1.6.0 ======================== Index: cmpiOSBase_ProcessorProvider.c =================================================================== RCS file: /cvsroot/sblim/cmpi-base/cmpiOSBase_ProcessorProvider.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- cmpiOSBase_ProcessorProvider.c 25 Jul 2009 00:37:30 -0000 1.11 +++ cmpiOSBase_ProcessorProvider.c 21 Dec 2010 02:48:09 -0000 1.12 @@ -30,6 +30,7 @@ #include "OSBase_Common.h" #include "cmpiOSBase_Common.h" #include "cmpiOSBase_Processor.h" +#include "OSBase_Processor.h" static const CMPIBroker * _broker; @@ -51,6 +52,7 @@ CMPIStatus OSBase_ProcessorProviderCleanup( CMPIInstanceMI * mi, const CMPIContext * ctx, CMPIBoolean terminate) { _OSBASE_TRACE(1,("--- %s CMPI Cleanup() called",_ClassName)); + proc_cancel_thread(); _OSBASE_TRACE(1,("--- %s CMPI Cleanup() exited",_ClassName)); CMReturn(CMPI_RC_OK); } Index: OSBase_Processor.h =================================================================== RCS file: /cvsroot/sblim/cmpi-base/OSBase_Processor.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- OSBase_Processor.h 25 Jul 2009 00:37:30 -0000 1.6 +++ OSBase_Processor.h 21 Dec 2010 02:48:09 -0000 1.7 @@ -58,6 +58,8 @@ void free_processorlist( struct processorlist * ); void free_processor( struct cim_processor * ); +int proc_cancel_thread(); + /* ---------------------------------------------------------------------------*/ #ifdef __cplusplus Index: OSBase_Processor.c =================================================================== RCS file: /cvsroot/sblim/cmpi-base/OSBase_Processor.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- OSBase_Processor.c 25 Jul 2009 00:37:30 -0000 1.16 +++ OSBase_Processor.c 21 Dec 2010 02:48:09 -0000 1.17 @@ -56,6 +56,7 @@ #define SAMPLE_PERIOD 60 #define SAMPLE_INTERVAL 10 static int SAMPLE_CPU = 1; +static int running = 1; static pthread_t tid; @@ -123,12 +124,6 @@ struct cpu_sample * cur_ptr; int i; - /* SAMPLE_CPU = 0; */ - /* pthread_join(tid, NULL); */ - - pthread_cancel(tid); - /* sleep(1); */ - for (i = 0; i < num_cpus; i++) { cur_ptr = cpu_samples[i]->next; cpu_samples[i]->next = NULL; @@ -143,6 +138,13 @@ /* free(cpu_loads); */ } +int proc_cancel_thread() { + running = 0; + pthread_join(tid, NULL); + + return 1; +} + int enum_all_processor( struct processorlist ** lptr ) { struct processorlist * lptrhelp = NULL; char ** hdout = NULL; @@ -555,7 +557,7 @@ int count = 0; int i; - while (1) { + while (running) { sleep(SAMPLE_INTERVAL); for (i = 0; i < num_cpus; i++) { |