+int wxThread::GetCPUCount()
+{
+ ULONG CPUCount;
+ APIRET ulrc;
+ ulrc = ::DosQuerySysInfo(26, 26, (void *)&CPUCount, sizeof(ULONG));
+ // QSV_NUMPROCESSORS(26) is typically not defined in header files
+
+ if (ulrc != 0)
+ CPUCount = 1;
+
+ return CPUCount;
+}
+
+unsigned long wxThread::GetCurrentId()
+{
+ PTIB ptib;
+ PPIB ppib;
+
+ ::DosGetInfoBlocks(&ptib, &ppib);
+ return (unsigned long) ptib->tib_ptib2->tib2_ultid;
+}
+
+bool wxThread::SetConcurrency(size_t level)
+{
+ wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") );
+
+ // ok only for the default one
+ if ( level == 0 )
+ return 0;
+
+ // Don't know how to realize this on OS/2.
+ return level == 1;
+}
+
+// ctor and dtor
+// -------------
+
+wxThread::wxThread(wxThreadKind kind)
+{
+ m_internal = new wxThreadInternal();
+
+ m_isDetached = kind == wxTHREAD_DETACHED;
+}
+
+wxThread::~wxThread()
+{
+ delete m_internal;
+}
+