- Fix deadlock that blocked PythonPolicy::sort_queue
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@796 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
ebeda15359
commit
6c79bc361c
5 changed files with 15 additions and 20 deletions
|
@ -46,7 +46,7 @@ namespace sgpem
|
|||
static Instantiated_class& get_instance();
|
||||
|
||||
protected:
|
||||
static Glib::StaticMutex SG_DLLLOCAL _mutex;
|
||||
static Glib::RecMutex SG_DLLLOCAL _mutex;
|
||||
|
||||
private:
|
||||
static SG_DLLLOCAL Instantiated_class* _instance;
|
||||
|
|
|
@ -26,15 +26,15 @@ Instantiated_class*
|
|||
sgpem::Singleton<Instantiated_class>::_instance = NULL;
|
||||
|
||||
template<typename Instantiated_class>
|
||||
Glib::StaticMutex
|
||||
sgpem::Singleton<Instantiated_class>::_mutex = GLIBMM_STATIC_MUTEX_INIT;
|
||||
Glib::RecMutex
|
||||
sgpem::Singleton<Instantiated_class>::_mutex;
|
||||
|
||||
|
||||
template<typename Instantiated_class>
|
||||
Instantiated_class&
|
||||
sgpem::Singleton<Instantiated_class>::get_instance()
|
||||
{
|
||||
Glib::Mutex::Lock lock(_mutex);
|
||||
Glib::RecMutex::Lock lock(_mutex);
|
||||
if(_instance == NULL)
|
||||
_instance = new Instantiated_class();
|
||||
return *_instance;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue