diff options
Diffstat (limited to 'raul')
-rw-r--r-- | raul/Atom.h | 11 | ||||
-rw-r--r-- | raul/AtomLiblo.h | 10 | ||||
-rw-r--r-- | raul/AtomRaptor.h | 11 | ||||
-rw-r--r-- | raul/AtomicInt.h | 12 | ||||
-rw-r--r-- | raul/AtomicPtr.h | 12 | ||||
-rw-r--r-- | raul/Condition.h | 10 | ||||
-rw-r--r-- | raul/JackDriver.h | 34 | ||||
-rw-r--r-- | raul/Mutex.h | 10 | ||||
-rw-r--r-- | raul/Namespaces.h | 10 | ||||
-rw-r--r-- | raul/Path.h | 12 | ||||
-rw-r--r-- | raul/Process.h | 6 | ||||
-rw-r--r-- | raul/RDFQuery.h | 12 | ||||
-rw-r--r-- | raul/RDFWriter.h | 39 | ||||
-rw-r--r-- | raul/SRMWQueue.h | 10 | ||||
-rw-r--r-- | raul/SRSWQueue.h | 10 | ||||
-rw-r--r-- | raul/Semaphore.h | 10 | ||||
-rw-r--r-- | raul/SharedPtr.h | 4 | ||||
-rw-r--r-- | raul/Slave.h | 6 | ||||
-rw-r--r-- | raul/Thread.h | 11 | ||||
-rw-r--r-- | raul/WeakPtr.h | 2 |
20 files changed, 160 insertions, 82 deletions
diff --git a/raul/Atom.h b/raul/Atom.h index 372cd78..3bfa68f 100644 --- a/raul/Atom.h +++ b/raul/Atom.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -24,6 +24,8 @@ using std::string; +namespace Raul { + /** An OSC atom (fundamental data types OSC messages are composed of). * @@ -126,4 +128,7 @@ private: }; }; + +} // namespace Raul + #endif // RAUL_ATOM_H diff --git a/raul/AtomLiblo.h b/raul/AtomLiblo.h index 6812dcf..c1c7d60 100644 --- a/raul/AtomLiblo.h +++ b/raul/AtomLiblo.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -20,6 +20,8 @@ #include <lo/lo.h> #include "raul/Atom.h" +namespace Raul { + /** Support for serializing an Atom to/from liblo messages. * @@ -72,4 +74,6 @@ public: }; +} // namespace Raul + #endif // RAUL_ATOM_LIBLO_H diff --git a/raul/AtomRaptor.h b/raul/AtomRaptor.h index 9323918..87f871f 100644 --- a/raul/AtomRaptor.h +++ b/raul/AtomRaptor.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -26,6 +26,9 @@ using std::cerr; using std::endl; #define U(x) ((const unsigned char*)(x)) +namespace Raul { + + /** Support for serializing an Atom to/from RDF (via raptor, a part of librdf). * * (Here to prevent a unnecessary raptor dependency for Atom). @@ -96,4 +99,6 @@ public: }; +} // namespace Raul + #endif // RAUL_ATOM_RAPTOR_H diff --git a/raul/AtomicInt.h b/raul/AtomicInt.h index ba8e4b0..2678f31 100644 --- a/raul/AtomicInt.h +++ b/raul/AtomicInt.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2007 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -19,6 +19,9 @@ #include <glib.h> +namespace Raul { + + class AtomicInt { public: @@ -72,4 +75,7 @@ private: volatile int _val; }; + +} // namespace Raul + #endif // RAUL_ATOMIC_INT_H diff --git a/raul/AtomicPtr.h b/raul/AtomicPtr.h index 8209ca6..287fe2c 100644 --- a/raul/AtomicPtr.h +++ b/raul/AtomicPtr.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2007 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -19,6 +19,9 @@ #include <glib.h> +namespace Raul { + + template<typename T> class AtomicPtr { public: @@ -40,4 +43,7 @@ private: volatile T* _val; }; + +} // namespace Raul + #endif // RAUL_ATOMIC_PTR_H diff --git a/raul/Condition.h b/raul/Condition.h index 5517225..18fb05f 100644 --- a/raul/Condition.h +++ b/raul/Condition.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -20,6 +20,8 @@ #include <pthread.h> #include <boost/utility.hpp> +namespace Raul { + /** Trivial (zero overhead) wrapper around POSIX Conditions. * @@ -41,5 +43,7 @@ private: }; +} // namespace Raul + #endif // RAUL_CONDITION_H diff --git a/raul/JackDriver.h b/raul/JackDriver.h index b16eeb3..22e2002 100644 --- a/raul/JackDriver.h +++ b/raul/JackDriver.h @@ -24,6 +24,8 @@ using std::string; +namespace Raul { + /** Handles all externally driven functionality, registering ports etc. * @@ -39,29 +41,29 @@ public: void attach(const string& client_name); void detach(); - bool is_attached() const { return (m_client != NULL); } - bool is_realtime() const { return m_client && jack_is_realtime(m_client); } + bool is_attached() const { return (_client != NULL); } + bool is_realtime() const { return _client && jack_is_realtime(_client); } - void start_transport() { jack_transport_start(m_client); } - void stop_transport() { jack_transport_stop(m_client); } + void start_transport() { jack_transport_start(_client); } + void stop_transport() { jack_transport_stop(_client); } void rewind_transport() { jack_position_t zero; zero.frame = 0; zero.valid = (jack_position_bits_t)0; - jack_transport_reposition(m_client, &zero); + jack_transport_reposition(_client, &zero); } jack_nframes_t buffer_size(); bool set_buffer_size(jack_nframes_t size); - inline float sample_rate() { return jack_get_sample_rate(m_client); } + inline float sample_rate() { return jack_get_sample_rate(_client); } - inline size_t xruns() { return m_xruns; } + inline size_t xruns() { return _xruns; } void reset_xruns(); - inline float max_delay() { return jack_get_max_delayed_usecs(m_client); } - inline void reset_delay() { jack_reset_max_delayed_usecs(m_client); } + inline float max_delay() { return jack_get_max_delayed_usecs(_client); } + inline void reset_delay() { jack_reset_max_delayed_usecs(_client); } protected: /** Process callback. Derived classes should do all audio processing here. */ @@ -94,14 +96,16 @@ private: static int jack_xrun_cb(void* me); static void jack_shutdown_cb(void* me); - jack_client_t* m_client; + jack_client_t* _client; - bool m_is_activated; - jack_position_t m_last_pos; - jack_nframes_t m_buffer_size; - size_t m_xruns; - float m_xrun_delay; + bool _is_activated; + jack_position_t _last_pos; + jack_nframes_t _buffer_size; + size_t _xruns; + float _xrun_delay; }; +} // namespace Raul + #endif // RAUL_JACKDRIVER_H diff --git a/raul/Mutex.h b/raul/Mutex.h index bf16d3c..8077ba9 100644 --- a/raul/Mutex.h +++ b/raul/Mutex.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -20,6 +20,8 @@ #include <pthread.h> #include <boost/utility.hpp> +namespace Raul { + /** Trivial (zero overhead) wrapper around POSIX Mutexes. * @@ -41,4 +43,6 @@ private: }; +} // namespace Raul + #endif // RAUL_MUTEX_H diff --git a/raul/Namespaces.h b/raul/Namespaces.h index d28089f..1de95f8 100644 --- a/raul/Namespaces.h +++ b/raul/Namespaces.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -20,6 +20,8 @@ #include <map> #include <string> +namespace Raul { + /** Collection of RDF namespaces with prefixes. */ @@ -29,4 +31,6 @@ public: }; +} // namespace Raul + #endif // RAUL_NAMESPACES_H diff --git a/raul/Path.h b/raul/Path.h index 200d05e..e68d507 100644 --- a/raul/Path.h +++ b/raul/Path.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006-2007 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007-2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -22,6 +22,8 @@ #include <cassert> using std::string; +namespace Raul { + /** Simple wrapper around standard string with useful path-specific methods. * @@ -118,6 +120,8 @@ public: return (*this) + "/"; } }; - + + +} // namespace Raul #endif // RAUL_PATH_H diff --git a/raul/Process.h b/raul/Process.h index a8cf043..5504440 100644 --- a/raul/Process.h +++ b/raul/Process.h @@ -1,4 +1,4 @@ -/* This file is part of Raul. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * * Raul 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 @@ -22,6 +22,8 @@ #include <unistd.h> #include <boost/utility.hpp> +namespace Raul { + /** A child process. * @@ -82,4 +84,6 @@ private: }; +} // namespace Raul + #endif // RAUL_PROCESS_H diff --git a/raul/RDFQuery.h b/raul/RDFQuery.h index 8b0f362..b0709b2 100644 --- a/raul/RDFQuery.h +++ b/raul/RDFQuery.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -22,10 +22,12 @@ #include <glibmm/ustring.h> #include "raul/Namespaces.h" +namespace Raul { + /** Pretty wrapper for a SPARQL query. * - * Automatically handles things like prepending prefixes, etc. Ingen specific. + * Automatically handles things like prepending prefixes, etc. Raul specific. */ class RDFQuery { public: @@ -67,5 +69,7 @@ private: }; +} // namespace Raul + #endif // RAUL_RDFQUERY_H diff --git a/raul/RDFWriter.h b/raul/RDFWriter.h index c67645e..f2dfadd 100644 --- a/raul/RDFWriter.h +++ b/raul/RDFWriter.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -19,24 +19,25 @@ #include <stdexcept> #include <string> -#include <map> #include <raptor.h> +#include "raul/Namespaces.h" #include "raul/Atom.h" -using std::string; using std::map; + +namespace Raul { class RdfId { public: enum Type { ANONYMOUS, RESOURCE }; - RdfId(Type t, const string& s) : _type(t), _string(s) {} + RdfId(Type t, const std::string& s) : _type(t), _string(s) {} - Type type() const { return _type; } - const string& to_string() const { return _string; } + Type type() const { return _type; } + const std::string& to_string() const { return _string; } private: - Type _type; - string _string; ///< URI or blank node ID, depending on _type + Type _type; + std::string _string; ///< URI or blank node ID, depending on _type }; @@ -44,12 +45,12 @@ class RDFWriter { public: RDFWriter(); - void add_prefix(const string& prefix, const string& uri); - string expand_uri(const string& uri); + void add_prefix(const std::string& prefix, const std::string& uri); + std::string expand_uri(const std::string& uri); - void start_to_filename(const string& filename) throw (std::logic_error); - void start_to_string() throw (std::logic_error); - string finish() throw (std::logic_error); + void start_to_filename(const std::string& filename) throw (std::logic_error); + void start_to_string() throw (std::logic_error); + std::string finish() throw (std::logic_error); bool serialization_in_progress() { return (_serializer != NULL); } @@ -64,10 +65,12 @@ public: private: void setup_prefixes(); - raptor_serializer* _serializer; - unsigned char* _string_output; - map<string, string> _prefixes; + raptor_serializer* _serializer; + unsigned char* _string_output; + Namespaces _prefixes; }; +} // namespace Raul + #endif // RDFWRITER_H diff --git a/raul/SRMWQueue.h b/raul/SRMWQueue.h index 2a4955c..5b7273a 100644 --- a/raul/SRMWQueue.h +++ b/raul/SRMWQueue.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -25,6 +25,8 @@ #include <iostream> using namespace std; +namespace Raul { + /** Realtime-safe single-reader multi-writer queue (aka lock-free ringbuffer) * @@ -198,4 +200,6 @@ SRMWQueue<T>::pop() } +} // namespace Raul + #endif // RAUL_SRMW_QUEUE_H diff --git a/raul/SRSWQueue.h b/raul/SRSWQueue.h index e7dd60d..b23f2f7 100644 --- a/raul/SRSWQueue.h +++ b/raul/SRSWQueue.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -22,6 +22,8 @@ #include <boost/utility.hpp> #include "raul/AtomicInt.h" +namespace Raul { + /** Realtime-safe single-reader single-writer queue (aka lock-free ringbuffer) * @@ -149,4 +151,6 @@ SRSWQueue<T>::pop() } +} // namespace Raul + #endif // RAUL_SRSW_QUEUE_H diff --git a/raul/Semaphore.h b/raul/Semaphore.h index bd06b65..d5195ba 100644 --- a/raul/Semaphore.h +++ b/raul/Semaphore.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -20,6 +20,8 @@ #include <semaphore.h> #include <boost/utility.hpp> +namespace Raul { + /** Trivial wrapper around POSIX semaphores (zero memory overhead). * @@ -63,4 +65,6 @@ private: }; +} // namespace Raul + #endif // RAUL_SEMAPHORE_H diff --git a/raul/SharedPtr.h b/raul/SharedPtr.h index 89600a9..e5381b6 100644 --- a/raul/SharedPtr.h +++ b/raul/SharedPtr.h @@ -1,5 +1,5 @@ /* A Reference Counting Smart Pointer. - * Copyright (C) 2006 Dave Robillard. + * Copyright (C) 2007 Dave Robillard. * * This 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 @@ -53,7 +53,7 @@ namespace boost { #ifdef BOOST_AC_USE_PTHREADS #error "Boost is using mutex locking for pointer reference counting." -#error "This is VERY slow. Please report your platform." +#error "This is VERY slow. Please report your platform to dave@codeson.net" #endif #define SharedPtr boost::shared_ptr diff --git a/raul/Slave.h b/raul/Slave.h index 8f20140..e80fbeb 100644 --- a/raul/Slave.h +++ b/raul/Slave.h @@ -1,4 +1,4 @@ -/* This file is part of Raul. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * * Raul 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 @@ -21,6 +21,8 @@ #include "raul/Semaphore.h" #include "raul/Thread.h" +namespace Raul { + /** Thread driven by (realtime safe) signals. * @@ -59,4 +61,6 @@ private: }; +} // namespace Raul + #endif // RAUL_SLAVE_H diff --git a/raul/Thread.h b/raul/Thread.h index 2a7a321..694d463 100644 --- a/raul/Thread.h +++ b/raul/Thread.h @@ -1,11 +1,11 @@ -/* This file is part of Ingen. Copyright (C) 2006 Dave Robillard. +/* This file is part of Raul. Copyright (C) 2007 Dave Robillard. * - * Ingen is free software; you can redistribute it and/or modify it under the + * Raul 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 2 of the License, or (at your option) any later * version. * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + * Raul 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 details. * @@ -22,6 +22,8 @@ #include <pthread.h> #include <boost/utility.hpp> +namespace Raul { + /** Abstract base class for a thread. * @@ -106,6 +108,7 @@ protected: Thread(const std::string& name="") : _context(0), _name(name), _pthread_exists(false) { pthread_once(&_thread_key_once, thread_key_alloc); + pthread_setspecific(_thread_key, this); } /** Must be called from thread */ @@ -151,4 +154,6 @@ private: }; +} // namespace Raul + #endif // RAUL_THREAD_H diff --git a/raul/WeakPtr.h b/raul/WeakPtr.h index 3523d25..1793608 100644 --- a/raul/WeakPtr.h +++ b/raul/WeakPtr.h @@ -1,5 +1,5 @@ /* A "weak" pointer to a resource owned by a shared pointer. - * Copyright (C) 2006 Dave Robillard. + * Copyright (C) 2007 Dave Robillard. * * This 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 |