Fix TODO in SkMutex_win.h to prevent accidental copying.

R=mtklein@google.com

Review URL: https://codereview.chromium.org/129533002

git-svn-id: http://skia.googlecode.com/svn/trunk@12979 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bungeman@google.com 2014-01-09 00:02:52 +00:00
Родитель 41bf930039
Коммит ca38f2c86e
1 изменённых файлов: 4 добавлений и 14 удалений

Просмотреть файл

@ -30,22 +30,9 @@
# undef NOMINMAX
#endif
// TODO: this exists because SK_DECLARE_STATIC_ONCE in methods is currently
// relying on a compiler bug which allows the '=' to work.
// All use of SK_DECLARE_STATIC_ONCE in methods is unsafe, and must be removed.
// To find these cases, make SkMutex's copy and assignement private directly.
class SkNoncopyableMutex {
public:
SkNoncopyableMutex() { }
private:
SkNoncopyableMutex(const SkNoncopyableMutex&);
SkNoncopyableMutex& operator=(const SkNoncopyableMutex&);
};
// On Windows, SkBaseMutex and SkMutex are the same thing,
// we can't easily get rid of static initializers.
class SkMutex : SkNoncopyableMutex {
class SkMutex {
public:
SkMutex() {
InitializeCriticalSection(&fStorage);
@ -64,6 +51,9 @@ public:
}
private:
SkMutex(const SkMutex&);
SkMutex& operator=(const SkMutex&);
CRITICAL_SECTION fStorage;
};