ソースを参照

thread var initialization fixes

AzaezelX 2 年 前
コミット
835d6f009a

+ 1 - 1
Engine/source/platform/threads/threadSafePriorityQueue.h

@@ -389,7 +389,7 @@ inline ThreadSafePriorityQueue< T, K, SORT_MIN_TO_MAX, MAX_LEVEL, PROBABILISTIC_
      mPriority( priority ),
      mValue( value )
 {
-   dMemset( mNext, 0, sizeof( Node* ) * ( getLevel() + 1 ) );
+   dMemset( mNext, 0, sizeof( Node* ) * (U32)( getLevel() + 1 ) );
 
    // Level is already set by the allocation routines.
 }

+ 1 - 1
Engine/source/platform/threads/threadSafeRefCount.h

@@ -61,7 +61,7 @@ class ThreadSafeRefCount
 
       ThreadSafeRefCount()
          : mRefCount( 0 ) {}
-      ThreadSafeRefCount( bool noSet ) : mRefCount(0) {}
+      ThreadSafeRefCount( bool noSet ) {}
 
       bool           isShared() const;
       U32            getRefCount() const;

+ 6 - 6
Engine/source/platformSDL/threads/thread.cpp

@@ -30,13 +30,13 @@
 class PlatformThreadData
 {
 public:
-   ThreadRunFunction       mRunFunc;
-   void*                   mRunArg;
-   Thread*                 mThread;
+   ThreadRunFunction       mRunFunc = NULL;
+   void*                   mRunArg = NULL;
+   Thread*                 mThread = NULL;
    Semaphore               mGateway; // default count is 1
-   SDL_threadID            mThreadID;
-   SDL_Thread*             mSdlThread;
-   bool                    mDead;
+   SDL_threadID            mThreadID = 0;
+   SDL_Thread*             mSdlThread = NULL;
+   bool                    mDead = true;
 };
 
 ThreadManager::MainThreadId ThreadManager::smMainThreadId;