changeset 106:dd73915dfe99

Minor cleanup of C++ code -- removed unused thread_counter
author Deepak Bhole <dbhole@redhat.com>
date Thu, 03 Mar 2011 17:04:56 -0500
parents 05e15b654ff0
children fb436cda450e
files ChangeLog plugin/icedteanp/IcedTeaPluginRequestProcessor.cc plugin/icedteanp/IcedTeaPluginRequestProcessor.h
diffstat 3 files changed, 11 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 02 11:58:03 2011 -0500
+++ b/ChangeLog	Thu Mar 03 17:04:56 2011 -0500
@@ -1,3 +1,14 @@
+2011-03-03  Deepak Bhole <dbhole@redhat.com>
+
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.cc
+	(PluginRequestProcessor): Remove initialization of tc_mutex
+	(~PluginRequestProcessor): Remove destruction of tc_mutex
+	(sendString): Removed thread count incrementer code.
+	(setMember): Same.
+	(sendMember): Same.
+	* plugin/icedteanp/IcedTeaPluginRequestProcessor.h: Removed tc_mutex and
+	thread_count variables. 
+
 2011-03-02  Omair Majid  <omajid@redhat.com>
 
 	Fix PR612.
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Wed Mar 02 11:58:03 2011 -0500
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.cc	Thu Mar 03 17:04:56 2011 -0500
@@ -66,7 +66,6 @@
 
     pthread_mutex_init(&message_queue_mutex, NULL);
     pthread_mutex_init(&syn_write_mutex, NULL);
-    pthread_mutex_init(&tc_mutex, NULL);
 
     pthread_cond_init(&cond_message_available, NULL);
 }
@@ -86,7 +85,6 @@
 
     pthread_mutex_destroy(&message_queue_mutex);
     pthread_mutex_destroy(&syn_write_mutex);
-    pthread_mutex_destroy(&tc_mutex);
 
     pthread_cond_destroy(&cond_message_available);
 }
@@ -415,12 +413,6 @@
     response += thread_data.result;
 
     plugin_to_java_bus->post(response.c_str());
-
-    cleanup:
-
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
 }
 
 /**
@@ -508,13 +500,6 @@
     IcedTeaPluginUtilities::constructMessagePrefix(0, reference, &response);
     response.append(" JavaScriptSetMember ");
     plugin_to_java_bus->post(response.c_str());
-
-    cleanup:
-
-    // property_name, type and value are deleted by _setMember
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
 }
 
 /**
@@ -660,14 +645,6 @@
     }
     response.append(java_result->return_string->c_str());
     plugin_to_java_bus->post(response.c_str());
-
-
-    // Now be a good citizen and help keep the heap free of garbage
-    cleanup:
-
-    pthread_mutex_lock(&tc_mutex);
-    thread_count--;
-    pthread_mutex_unlock(&tc_mutex);
 }
 
 /**
--- a/plugin/icedteanp/IcedTeaPluginRequestProcessor.h	Wed Mar 02 11:58:03 2011 -0500
+++ b/plugin/icedteanp/IcedTeaPluginRequestProcessor.h	Thu Mar 03 17:04:56 2011 -0500
@@ -84,9 +84,6 @@
 void _eval(void* data);
 void _getString(void* data);
 
-static pthread_mutex_t tc_mutex = PTHREAD_MUTEX_INITIALIZER;
-static int thread_count = 0;
-
 void* queue_processor(void* data);
 
 /* Mutex to ensure that the request queue is accessed synchronously */