summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/r3/os2/thread-os2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/VBox/Runtime/r3/os2/thread-os2.cpp')
-rw-r--r--src/VBox/Runtime/r3/os2/thread-os2.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/src/VBox/Runtime/r3/os2/thread-os2.cpp b/src/VBox/Runtime/r3/os2/thread-os2.cpp
index 76c30288c..8b85f4324 100644
--- a/src/VBox/Runtime/r3/os2/thread-os2.cpp
+++ b/src/VBox/Runtime/r3/os2/thread-os2.cpp
@@ -1,4 +1,4 @@
-/* $Id: thread-os2.cpp $ */
+/* $Id: thread-os2.cpp 37154 2011-05-19 12:54:32Z vboxsync $ */
/** @file
* IPRT - Threads, OS/2.
*/
@@ -63,7 +63,7 @@ static PRTTHREADINT *g_ppCurThread;
static void rtThreadNativeMain(void *pvArgs);
-int rtThreadNativeInit(void)
+DECLHIDDEN(int) rtThreadNativeInit(void)
{
/*
* Allocate thread local memory.
@@ -77,7 +77,7 @@ int rtThreadNativeInit(void)
}
-int rtThreadNativeAdopt(PRTTHREADINT pThread)
+DECLHIDDEN(int) rtThreadNativeAdopt(PRTTHREADINT pThread)
{
/*
* Block SIGALRM - required for timer-posix.cpp.
@@ -94,7 +94,7 @@ int rtThreadNativeAdopt(PRTTHREADINT pThread)
}
-void rtThreadNativeDestroy(PRTTHREADINT pThread)
+DECLHIDDEN(void) rtThreadNativeDestroy(PRTTHREADINT pThread)
{
if (pThread == *g_ppCurThread)
*g_ppCurThread = NULL;
@@ -133,7 +133,7 @@ static void rtThreadNativeMain(void *pvArgs)
}
-int rtThreadNativeCreate(PRTTHREADINT pThread, PRTNATIVETHREAD pNativeThread)
+DECLHIDDEN(int) rtThreadNativeCreate(PRTTHREADINT pThread, PRTNATIVETHREAD pNativeThread)
{
/*
* Default stack size.
@@ -198,7 +198,12 @@ RTDECL(bool) RTThreadYield(void)
}
-RTDECL(uint64_t) RTThreadGetAffinity(void)
+RTR3DECL(int) RTThreadGetAffinity(PRTCPUSET pCpuSet)
+{
+ return VINF_SUCCESS;
+}
+
+RTR3DECL(int) RTThreadGetAffinity(PRTCPUSET pCpuSet)
{
union
{
@@ -206,21 +211,24 @@ RTDECL(uint64_t) RTThreadGetAffinity(void)
MPAFFINITY mpaff;
} u;
- int rc = DosQueryThreadAffinity(AFNTY_THREAD, &u.mpaff);
- if (rc)
- u.u64 = 1;
- return u.u64;
+ APIRET rc = DosQueryThreadAffinity(AFNTY_THREAD, &u.mpaff);
+ if (!rc)
+ {
+ RTCpuSetFromU64(pCpuSet, u.u64);
+ return VINF_SUCCESS;
+ }
+ return RTErrConvertFromOS2(rc);
}
-RTDECL(int) RTThreadSetAffinity(uint64_t u64Mask)
+RTR3DECL(int) RTThreadSetAffinity(PCRTCPUSET pCpuSet)
{
union
{
uint64_t u64;
MPAFFINITY mpaff;
} u;
- u.u64 = u64Mask;
+ u.u64 = pCpuSet ? RTCpuSetToU64(pCpuSet) : UINT64_MAX;
int rc = DosSetThreadAffinity(&u.mpaff);
if (!rc)
return VINF_SUCCESS;