Hi Tanguy,

> static Mutex s_mutex;
> 
> const char * getSingletonGlExtensionDisable()
> {
>     ScopedLock lock(s_mutex);
> 
>     static const char * env = getenv("OSG_GL_EXTENSION_DISABLE");
> 
>     return env;
> }

This doesn't make sense, because 'getenv' is called only once, during
the initialization of the static variable 'env'. After that the
value of 'env' doesn't change, but for every call to
'getSingletonGlExtensionDisable' a lock is used.

If the value of 'OSG_GL_EXTENSION_DISABLE' shouldn't change during
runtime:

static Mutex s_mutex;

const char* getSingletonGlExtensionDisable()
{
   static char* env = 0L;
   if (env == 0L) {
      ScopedLock lock(s_mutex);
      env = getenv("OSG_GL_EXTENSION_DISABLE");
   }

   return env;
}




Greetings,
Daniel


-- 
                                                                                
                                                           
 Daniel Trstenjak         Tel   : +49 (0)7071-9457-264
 science + computing ag   FAX   : +49 (0)7071-9457-511
 Hagellocher Weg 73       mailto: daniel.trsten...@science-computing.de
 D-72070 Tübingen         WWW   : http://www.science-computing.de/              
                                                        
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to