/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ // Original file Copyright Crytek GMBH or its affiliates, used under license. #ifndef CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H #define CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H #pragma once #include ////////////////////////////////////////////////////////////////////////// CryEvent::CryEvent() {} CryEvent::~CryEvent() {} void CryEvent::Reset() {} void CryEvent::Set() {} void CryEvent::Wait() const {} bool CryEvent::Wait(const uint32 timeoutMillis) const {} typedef CryEvent CryEventTimed; ////////////////////////////////////////////////////////////////////////// class _DummyLock { public: _DummyLock(); void Lock(); bool TryLock(); void Unlock(); #if defined(AZ_DEBUG_BUILD) bool IsLocked(); #endif }; template<> class CryLock : public _DummyLock { CryLock(const CryLock&); void operator = (const CryLock&); public: CryLock(); }; template<> class CryLock : public _DummyLock { CryLock(const CryLock&); void operator = (const CryLock&); public: CryLock(); }; template<> class CryCondLock : public CryLock { }; template<> class CryCondLock : public CryLock { }; template<> class CryCond< CryLock > { typedef CryLock LockT; CryCond(const CryCond&); void operator = (const CryCond&); public: CryCond(); void Notify(); void NotifySingle(); void Wait(LockT&); bool TimedWait(LockT &, uint32); }; template<> class CryCond< CryLock > { typedef CryLock LockT; CryCond(const CryCond&); void operator = (const CryCond&); public: CryCond(); void Notify(); void NotifySingle(); void Wait(LockT&); bool TimedWait(LockT &, uint32); }; class _DummyRWLock { public: _DummyRWLock() { } void RLock(); bool TryRLock(); void WLock(); bool TryWLock(); void Lock() { WLock(); } bool TryLock() { return TryWLock(); } void Unlock(); }; template class CrySimpleThread : public CryRunnable { public: typedef void (* ThreadFunction)(void*); CrySimpleThread(); virtual ~CrySimpleThread(); #if !defined(NO_THREADINFO) CryThreadInfo& GetInfo(); #endif const char* GetName(); void SetName(const char*); virtual void Run(); virtual void Cancel(); virtual void Start(Runnable&, unsigned = 0, const char* = NULL); virtual void Start(unsigned = 0, const char* = NULL); void StartFunction(ThreadFunction, void* = NULL, unsigned = 0); void Exit(); void Join(); unsigned SetCpuMask(unsigned); unsigned GetCpuMask(); void Stop(); bool IsStarted() const; bool IsRunning() const; }; #endif // CRYINCLUDE_CRYCOMMON_CRYTHREAD_DUMMY_H