Skip to content

Commit

Permalink
Fix Platform Thread Override
Browse files Browse the repository at this point in the history
  • Loading branch information
lucypero committed Sep 29, 2021
1 parent de91700 commit 5fe1857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
6 changes: 2 additions & 4 deletions core/os/thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

// Define PLATFORM_CUSTOM_THREAD_H in platform_config.h
// Overriding the platform implementation is required in some proprietary platforms
#ifndef PLATFORM_CUSTOM_THREAD_H
#ifndef PLATFORM_THREAD_OVERRIDE // See details in thread.h

#include "thread.h"

Expand Down Expand Up @@ -130,4 +128,4 @@ Thread::~Thread() {
}

#endif
#endif // PLATFORM_CUSTOM_THREAD_H
#endif // PLATFORM_THREAD_OVERRIDE
9 changes: 5 additions & 4 deletions core/os/thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/

// Define PLATFORM_CUSTOM_THREAD_H in platform_config.h
// Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h`
// to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`
// Overriding the platform implementation is required in some proprietary platforms
#ifdef PLATFORM_CUSTOM_THREAD_H
#include PLATFORM_CUSTOM_THREAD_H
#ifdef PLATFORM_THREAD_OVERRIDE
#include "platform_thread.h"
#else
#ifndef THREAD_H
#define THREAD_H
Expand Down Expand Up @@ -121,4 +122,4 @@ class Thread {
};

#endif // THREAD_H
#endif // PLATFORM_CUSTOM_THREAD_H
#endif // PLATFORM_THREAD_OVERRIDE

0 comments on commit 5fe1857

Please sign in to comment.