gfx/skia/trunk/src/ports/SkMutex_none.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/ports/SkMutex_none.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +/*
     1.5 + * Copyright 2013 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef SkMutex_none_DEFINED
    1.12 +#define SkMutex_none_DEFINED
    1.13 +
    1.14 +/** Non-mutex mutex for uniprocessor systems. */
    1.15 +
    1.16 +struct SkBaseMutex {
    1.17 +    void acquire() { }
    1.18 +    void release() { }
    1.19 +};
    1.20 +
    1.21 +class SkMutex : public SkBaseMutex {
    1.22 +public:
    1.23 +    SkMutex() { }
    1.24 +    ~SkMutex() { }
    1.25 +
    1.26 +private:
    1.27 +    SkMutex(const SkMutex&);
    1.28 +    SkMutex& operator=(const SkMutex&);
    1.29 +};
    1.30 +
    1.31 +// Using POD-style initialization prevents the generation of a static initializer.
    1.32 +#define SK_DECLARE_STATIC_MUTEX(name) static SkBaseMutex name = { }
    1.33 +
    1.34 +// Special case used when the static mutex must be available globally.
    1.35 +#define SK_DECLARE_GLOBAL_MUTEX(name) SkBaseMutex name = { }
    1.36 +
    1.37 +#endif

mercurial