Added wxThread::GetCurrentId(), which returns an ID for the current
thread, even if it is not a wxThread. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -441,30 +441,14 @@ PyObject* wxPyConstructObject(void* ptr,
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// TODO: This should really be wxThread::GetCurrentId(), and I will do so
|
||||
// after I make a quick 2.3.2.1 release.
|
||||
|
||||
#ifdef WXP_WITH_THREAD
|
||||
#ifdef __WXGTK__ // does wxGTK always use pthreads?
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
inline
|
||||
unsigned long wxPyGetCurrentThreadId() {
|
||||
#ifdef __WXMSW__
|
||||
return (unsigned long)::GetCurrentThreadId();
|
||||
#endif
|
||||
#ifdef __WXGTK__ // does wxGTK always use pthreads?
|
||||
return (unsigned long)pthread_self();
|
||||
#endif
|
||||
#ifdef __WXMAC__
|
||||
ThreadID current ;
|
||||
MacGetCurrentThread( ¤t ) ;
|
||||
return (unsigned long)current;
|
||||
#endif
|
||||
return wxThread::GetCurrentId();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static
|
||||
PyThreadState* wxPyGetThreadState() {
|
||||
unsigned long ctid = wxPyGetCurrentThreadId();
|
||||
|
Reference in New Issue
Block a user