[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/rtmp r9838: add header file for Cygnal spe
From: |
rob |
Subject: |
[Gnash-commit] /srv/bzr/gnash/rtmp r9838: add header file for Cygnal specific classes. |
Date: |
Wed, 17 Dec 2008 10:21:36 -0700 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9838
committer: address@hidden
branch nick: rtmp
timestamp: Wed 2008-12-17 10:21:36 -0700
message:
add header file for Cygnal specific classes.
added:
cygnal/cygnal.h
=== added file 'cygnal/cygnal.h'
--- a/cygnal/cygnal.h 1970-01-01 00:00:00 +0000
+++ b/cygnal/cygnal.h 2008-12-17 17:21:36 +0000
@@ -0,0 +1,52 @@
+//
+// Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+#ifndef __CYGNAL_H__
+#define __CYGNAL_H__
+
+/// \namespace cygnal
+///
+/// This namespace is for all the Cygnal specific classes not used by
+/// anything else in Gnash.
+namespace cygnal {
+
+/// \class cygnal::ThreadCounter of threads currently
+/// active. This is primarily so the counter can be wrapped with a
+/// mutex to be thread safe, as threads delete themseleves.
+class DSOEXPORT ThreadCounter
+{
+ public:
+ ThreadCounter() : _tids(0) {};
+ void increment() { boost::mutex::scoped_lock lk(_tid_mutex); ++_tids; };
+ void decrement() { boost::mutex::scoped_lock lk(_tid_mutex); --_tids; };
+ int num_of_tids() { return _tids; };
+ private:
+ boost::mutex _tid_mutex;
+ int _tids;
+};
+
+// End of gnash namespace
+}
+
+// __CYGNAL_H__
+#endif
+
+
+// local Variables:
+// mode: C++
+// indent-tabs-mode: t
+// End:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/rtmp r9838: add header file for Cygnal specific classes.,
rob <=