blob: 561edcb8b7872fa81b1ab0d61a0f21c8a1794c98 [file] [log] [blame]
Jim Flynn1fdeb992020-07-09 07:28:37 +01001//
2// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#include "Threads.hpp"
7
8#if defined(__linux__)
9#include <unistd.h>
10#include <sys/syscall.h>
11#define gettid() syscall(SYS_gettid)
12#elif defined(_MSC_VER)
13#include "WindowsWrapper.hpp"
14#endif
15
16namespace armnnUtils
17{
18namespace Threads
19{
20
21int GetCurrentThreadId()
22{
23#if defined(__linux__)
24 return static_cast<int>(gettid());
25#elif defined(_MSC_VER)
26 return ::GetCurrentThreadId();
27#endif
28}
29
30}
31}