gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog libbase/log.cpp


From: Markus Gothe
Subject: [Gnash-commit] gnash ChangeLog libbase/log.cpp
Date: Wed, 11 Oct 2006 01:23:18 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Markus Gothe <nihilus>  06/10/11 01:23:18

Modified files:
        .              : ChangeLog 
        libbase        : log.cpp 

Log message:
        Fixed lightweight locking.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1129&r2=1.1130
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.cpp?cvsroot=gnash&r1=1.29&r2=1.30

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1129
retrieving revision 1.1130
diff -u -b -r1.1129 -r1.1130
--- ChangeLog   11 Oct 2006 00:16:58 -0000      1.1129
+++ ChangeLog   11 Oct 2006 01:23:17 -0000      1.1130
@@ -1,6 +1,7 @@
 2006-10-11 Markus Gothe <address@hidden>
 
        * macros/agg.m4: Added /usr/pkg/include.
+       * libbase/log.cpp: Fixed lightweight locking.
 
 2006-10-10 Sandro Santilli <address@hidden>
 

Index: libbase/log.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- libbase/log.cpp     5 Oct 2006 15:46:09 -0000       1.29
+++ libbase/log.cpp     11 Oct 2006 01:23:18 -0000      1.30
@@ -36,7 +36,7 @@
 //
 //
 
-/* $Id: log.cpp,v 1.29 2006/10/05 15:46:09 nihilus Exp $ */
+/* $Id: log.cpp,v 1.30 2006/10/11 01:23:18 nihilus Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -63,13 +63,17 @@
 #endif
 #include <ctime>
 #define BOOST_HAS_THREADS
-#include <boost/thread/mutex.hpp>
-static boost::mutex io_mutex;
+#include <boost/detail/lightweight_mutex.hpp>
+using boost::detail::lightweight_mutex;
+#define scoped_lock lightweight_mutex::scoped_lock
+static lightweight_mutex io_mutex;
+
 
 #include "log.h"
 
 using namespace std;
 
+
 namespace gnash {
 
 // static data to be hared amongst all classes.
@@ -382,7 +386,7 @@
 LogFile&
 LogFile::operator << (char x)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << x;
     }
@@ -400,7 +404,7 @@
 LogFile&
 LogFile::operator << (long x)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << x;
     }
@@ -418,7 +422,7 @@
 LogFile&
 LogFile::operator << (unsigned int x)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << x;
     }
@@ -436,7 +440,7 @@
 LogFile&
 LogFile::operator << (unsigned long x)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << x;
     }
@@ -454,7 +458,7 @@
 LogFile&
 LogFile::operator << (float x)
 { 
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose > 0) {
        cout << x;
     }
@@ -472,7 +476,7 @@
 LogFile&
 LogFile::operator << (double &x)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << x;
     }
@@ -507,8 +511,7 @@
 LogFile&
 LogFile::operator << (void *ptr)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
-    
+    scoped_lock lock(io_mutex);    
     if (_verbose) {
        cout << ptr;
     }
@@ -526,8 +529,7 @@
 LogFile& 
 LogFile::operator << (string &s)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
-
+    scoped_lock lock(io_mutex);
     if (_verbose) {
        cout << s;
     }
@@ -570,7 +572,7 @@
     // now we don't.
     int len = c.length();
 
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (len > 0) {
        if (c[len-1] == '\n') {
            //c[len-1] = 0;
@@ -622,7 +624,7 @@
       return *this;
     }
     
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_stamp == true && (_state == IDLE || _state == OPEN)) {
        _state = INPROGRESS;
        if (_verbose) {
@@ -649,8 +651,7 @@
 LogFile& 
 LogFile::operator << (const xmlChar *c)
 {
-    boost::mutex::scoped_lock lock(io_mutex);
-    
+    scoped_lock lock(io_mutex);    
     _logentry = timestamp();
     _logentry += ": ";
 
@@ -684,7 +685,7 @@
 ostream&
 LogFile::operator << (ostream & (&)(ostream &))
 {
-    boost::mutex::scoped_lock lock(io_mutex);
+    scoped_lock lock(io_mutex);
     if (_trace) {
        if (_verbose >= TRACELEVEL) {
            cout << "\r" << endl;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]