diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/utils/SkThreadUtils_pthread.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/utils/SkThreadUtils_pthread.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,43 @@ +/* + * Copyright 2012 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef SkThreadUtils_PThreadData_DEFINED +#define SkThreadUtils_PThreadData_DEFINED + +#include "SkThreadUtils.h" +#include + +class PThreadEvent : SkNoncopyable { +public: + PThreadEvent(); + ~PThreadEvent(); + void trigger(); + void wait(); + bool isTriggered(); + +private: + pthread_cond_t fCondition; + pthread_mutex_t fConditionMutex; + bool fConditionFlag; +}; + +class SkThread_PThreadData : SkNoncopyable { +public: + SkThread_PThreadData(SkThread::entryPointProc entryPoint, void* data); + ~SkThread_PThreadData(); + pthread_t fPThread; + bool fValidPThread; + PThreadEvent fStarted; + PThreadEvent fCanceled; + + pthread_attr_t fAttr; + + void* fParam; + SkThread::entryPointProc fEntryPoint; +}; + +#endif