michael@0: /* michael@0: * Copyright 2013 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef SkMutex_none_DEFINED michael@0: #define SkMutex_none_DEFINED michael@0: michael@0: /** Non-mutex mutex for uniprocessor systems. */ michael@0: michael@0: struct SkBaseMutex { michael@0: void acquire() { } michael@0: void release() { } michael@0: }; michael@0: michael@0: class SkMutex : public SkBaseMutex { michael@0: public: michael@0: SkMutex() { } michael@0: ~SkMutex() { } michael@0: michael@0: private: michael@0: SkMutex(const SkMutex&); michael@0: SkMutex& operator=(const SkMutex&); michael@0: }; michael@0: michael@0: // Using POD-style initialization prevents the generation of a static initializer. michael@0: #define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = { } michael@0: michael@0: // Special case used when the static mutex must be available globally. michael@0: #define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = { } michael@0: michael@0: #endif