Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: third_party/WebKit/Source/wtf/ThreadSpecificWin.cpp

Issue 2386843002: reflow comments in wtf (Closed)
Patch Set: comments (heh!) Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Jian Li <jianli@chromium.org> 2 * Copyright (C) 2009 Jian Li <jianli@chromium.org>
3 * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> 3 * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void threadSpecificSet(ThreadSpecificKey key, void* data) { 100 void threadSpecificSet(ThreadSpecificKey key, void* data) {
101 key->setValue(data); 101 key->setValue(data);
102 } 102 }
103 103
104 void* threadSpecificGet(ThreadSpecificKey key) { 104 void* threadSpecificGet(ThreadSpecificKey key) {
105 return key->value(); 105 return key->value();
106 } 106 }
107 107
108 void ThreadSpecificThreadExit() { 108 void ThreadSpecificThreadExit() {
109 for (long i = 0; i < tlsKeyCount(); i++) { 109 for (long i = 0; i < tlsKeyCount(); i++) {
110 // The layout of ThreadSpecific<T>::Data does not depend on T. So we are saf e to do the static cast to ThreadSpecific<int> in order to access its data membe r. 110 // The layout of ThreadSpecific<T>::Data does not depend on T. So we are
111 // safe to do the static cast to ThreadSpecific<int> in order to access its
112 // data member.
111 ThreadSpecific<int>::Data* data = 113 ThreadSpecific<int>::Data* data =
112 static_cast<ThreadSpecific<int>::Data*>(TlsGetValue(tlsKeys()[i])); 114 static_cast<ThreadSpecific<int>::Data*>(TlsGetValue(tlsKeys()[i]));
113 if (data) 115 if (data)
114 data->destructor(data); 116 data->destructor(data);
115 } 117 }
116 118
117 MutexLocker locker(destructorsMutex()); 119 MutexLocker locker(destructorsMutex());
118 PlatformThreadSpecificKey* key = destructorsList().head(); 120 PlatformThreadSpecificKey* key = destructorsList().head();
119 while (key) { 121 while (key) {
120 PlatformThreadSpecificKey* nextKey = key->next(); 122 PlatformThreadSpecificKey* nextKey = key->next();
121 key->callDestructor(); 123 key->callDestructor();
122 key = nextKey; 124 key = nextKey;
123 } 125 }
124 } 126 }
125 127
126 } // namespace WTF 128 } // namespace WTF
127 129
128 #endif // OS(WIN) 130 #endif // OS(WIN)
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/ThreadSpecific.h ('k') | third_party/WebKit/Source/wtf/Threading.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698