~ubuntu-branches/ubuntu/wily/wxwidgets3.0/wily-proposed

« back to all changes in this revision

Viewing changes to src/common/threadinfo.cpp

  • Committer: Package Import Robot
  • Author(s): Olly Betts
  • Date: 2014-06-18 12:42:22 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140618124222-y7t2vpsije1cesxy
Tags: 3.0.1-1
* New upstream release
  + Incorporates most of the patches we were carrying - only one left is:
    wx-config-conditionalise-webview-in-std.patch
* Drop versioning of dependencies from run-time libraries to wx-common -
  this will make the transition to the next wx version harder, and also
  makes backporting to wheezy more work.
* Mark -dbg packages as "Multi-Arch: same".
* Correct short descriptions of the webview packages to not just be
  copies of the corresponding media package's short description.
* Wrap 81 character line in package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
}
49
49
 
50
50
// Pointer to the current thread's instance
51
 
wxTLS_TYPE(wxThreadSpecificInfo*) g_thisThreadInfo;
 
51
inline wxTLS_TYPE_REF(wxThreadSpecificInfo*) GetThisThreadInfo()
 
52
{
 
53
    static wxTLS_TYPE(wxThreadSpecificInfo*) s_thisThreadInfo;
 
54
 
 
55
    return s_thisThreadInfo;
 
56
}
 
57
 
 
58
#define wxTHIS_THREAD_INFO wxTLS_VALUE(GetThisThreadInfo())
52
59
 
53
60
} // anonymous namespace
54
61
 
55
62
 
56
63
wxThreadSpecificInfo& wxThreadSpecificInfo::Get()
57
64
{
58
 
    if ( !wxTLS_VALUE(g_thisThreadInfo) )
 
65
    if ( !wxTHIS_THREAD_INFO )
59
66
    {
60
 
        wxTLS_VALUE(g_thisThreadInfo) = new wxThreadSpecificInfo;
 
67
        wxTHIS_THREAD_INFO = new wxThreadSpecificInfo;
61
68
        wxCriticalSectionLocker lock(GetAllThreadInfosCS());
62
69
        GetAllThreadInfos().push_back(
63
 
                wxSharedPtr<wxThreadSpecificInfo>(wxTLS_VALUE(g_thisThreadInfo)));
 
70
                wxSharedPtr<wxThreadSpecificInfo>(wxTHIS_THREAD_INFO));
64
71
    }
65
 
    return *wxTLS_VALUE(g_thisThreadInfo);
 
72
    return *wxTHIS_THREAD_INFO;
66
73
}
67
74
 
68
75
void wxThreadSpecificInfo::ThreadCleanUp()
69
76
{
70
 
    if ( !wxTLS_VALUE(g_thisThreadInfo) )
 
77
    if ( !wxTHIS_THREAD_INFO )
71
78
        return; // nothing to do, not used by this thread at all
72
79
 
73
80
    // find this thread's instance in GetAllThreadInfos() and destroy it
76
83
          i != GetAllThreadInfos().end();
77
84
          ++i )
78
85
    {
79
 
        if ( i->get() == wxTLS_VALUE(g_thisThreadInfo) )
 
86
        if ( i->get() == wxTHIS_THREAD_INFO )
80
87
        {
81
88
            GetAllThreadInfos().erase(i);
82
 
            wxTLS_VALUE(g_thisThreadInfo) = NULL;
 
89
            wxTHIS_THREAD_INFO = NULL;
83
90
            break;
84
91
        }
85
92
    }