+}
+
+bool wxThreadInternal::Create(wxThread *thread)
+{
+ // for compilers which have it, we should use C RTL function for thread
+ // creation instead of Win32 API one because otherwise we will have memory
+ // leaks if the thread uses C RTL (and most threads do)
+#ifdef __VISUALC__
+ typedef unsigned (__stdcall *RtlThreadStart)(void *);
+
+ m_hThread = (HANDLE)_beginthreadex(NULL, 0,
+ (RtlThreadStart)
+ wxThreadInternal::WinThreadStart,
+ thread, CREATE_SUSPENDED,
+ (unsigned int *)&m_tid);
+#else // !VC++
+ m_hThread = ::CreateThread
+ (
+ NULL, // default security
+ 0, // default stack size
+ (LPTHREAD_START_ROUTINE) // thread entry point
+ wxThreadInternal::WinThreadStart, //
+ (LPVOID)thread, // parameter
+ CREATE_SUSPENDED, // flags
+ &m_tid // [out] thread id
+ );
+#endif // VC++/!VC++
+
+ if ( m_hThread == NULL )
+ {
+ wxLogSysError(_("Can't create thread"));
+
+ return FALSE;
+ }
+
+ if ( m_priority != WXTHREAD_DEFAULT_PRIORITY )
+ {
+ SetPriority(m_priority);
+ }