projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
depereciate stringlist stuff in wxVariant
[wxWidgets.git]
/
src
/
unix
/
threadpsx.cpp
diff --git
a/src/unix/threadpsx.cpp
b/src/unix/threadpsx.cpp
index ae471b8d6bddb4d4cdf57f8bd19f5b2c8b97e5ec..8365dfc5ebd5fac7ddc0a570052e23e8ecebceb9 100644
(file)
--- a/
src/unix/threadpsx.cpp
+++ b/
src/unix/threadpsx.cpp
@@
-113,7
+113,7
@@
WX_DEFINE_ARRAY(wxThread *, wxArrayThread);
static wxArrayThread gs_allThreads;
// the id of the main thread
static wxArrayThread gs_allThreads;
// the id of the main thread
-static pthread_t gs_tidMain;
+static pthread_t gs_tidMain
= (pthread_t)-1
;
// the key for the pointer to the associated wxThread object
static pthread_key_t gs_keySelf;
// the key for the pointer to the associated wxThread object
static pthread_key_t gs_keySelf;
@@
-678,7
+678,7
@@
public:
private:
pthread_t m_threadId; // id of the thread
wxThreadState m_state; // see wxThreadState enum
private:
pthread_t m_threadId; // id of the thread
wxThreadState m_state; // see wxThreadState enum
- int m_prio; // in wxWi
ndow
s units: from 0 to 100
+ int m_prio; // in wxWi
dget
s units: from 0 to 100
// this flag is set when the thread should terminate
bool m_cancelled;
// this flag is set when the thread should terminate
bool m_cancelled;
@@
-957,7
+957,7
@@
wxThread *wxThread::This()
bool wxThread::IsMain()
{
bool wxThread::IsMain()
{
- return (bool)pthread_equal(pthread_self(), gs_tidMain);
+ return (bool)pthread_equal(pthread_self(), gs_tidMain)
|| gs_tidMain == (pthread_t)-1
;
}
void wxThread::Yield()
}
void wxThread::Yield()
@@
-969,7
+969,7
@@
void wxThread::Yield()
void wxThread::Sleep(unsigned long milliseconds)
{
void wxThread::Sleep(unsigned long milliseconds)
{
- wx
Us
leep(milliseconds);
+ wx
MilliS
leep(milliseconds);
}
int wxThread::GetCPUCount()
}
int wxThread::GetCPUCount()
@@
-1483,6
+1483,12
@@
void wxThread::Exit(ExitCode status)
// only call one thread function at a time :-(
DeleteThread(this);
}
// only call one thread function at a time :-(
DeleteThread(this);
}
+ else
+ {
+ m_critsect.Enter();
+ m_internal->SetState(STATE_EXITED);
+ m_critsect.Leave();
+ }
// terminate the thread (pthread_exit() never returns)
pthread_exit(status);
// terminate the thread (pthread_exit() never returns)
pthread_exit(status);