Ignore:
Timestamp:
Jun 1, 2010, 10:26:55 AM (15 years ago)
Author:
[email protected]
Message:

2010-06-01 Kwang Yul Seo <[email protected]>

Reviewed by Xan Lopez.

[GTK] Use DEFINE_STATIC_LOCAL for threadMapMutex and threadMap
https://bugs.webkit.org/show_bug.cgi?id=39831

Use DEFINE_STATIC_LOCAL for static local variables.

  • wtf/gtk/ThreadingGtk.cpp: (WTF::threadMapMutex): (WTF::threadMap): (WTF::identifierByGthreadHandle):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/gtk/ThreadingGtk.cpp

    r58266 r60486  
    3737#include "MainThread.h"
    3838#include "RandomNumberSeed.h"
     39#include <wtf/StdLibExtras.h>
    3940
    4041#include <glib.h>
     
    4344namespace WTF {
    4445
     46typedef HashMap<ThreadIdentifier, GThread*> ThreadMap;
     47
    4548static Mutex* atomicallyInitializedStaticMutex;
    4649
    4750static Mutex& threadMapMutex()
    4851{
    49     static Mutex mutex;
     52    DEFINE_STATIC_LOCAL(Mutex, mutex, ());
    5053    return mutex;
    5154}
     
    7578}
    7679
    77 static HashMap<ThreadIdentifier, GThread*>& threadMap()
    78 {
    79     static HashMap<ThreadIdentifier, GThread*> map;
     80static ThreadMap& threadMap()
     81{
     82    DEFINE_STATIC_LOCAL(ThreadMap, map, ());
    8083    return map;
    8184}
     
    8588    MutexLocker locker(threadMapMutex());
    8689
    87     HashMap<ThreadIdentifier, GThread*>::iterator i = threadMap().begin();
     90    ThreadMap::iterator i = threadMap().begin();
    8891    for (; i != threadMap().end(); ++i) {
    8992        if (i->second == thread)
Note: See TracChangeset for help on using the changeset viewer.