call to pthread_attr_setscope() added (disabled for now) and several other small fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 1999-03-30 11:09:18 +00:00
parent 4417b34387
commit 58230fb1b3

View File

@ -287,7 +287,7 @@ void *wxThreadInternal::PthreadStart(void *ptr)
int rc = pthread_setspecific(gs_keySelf, thread);
if ( rc != 0 )
{
wxLogSysError(rc, _("Can not start thread: error writing TLS."));
wxLogSysError(rc, _("Cannot start thread: error writing TLS"));
return (void *)-1;
}
@ -485,6 +485,11 @@ wxThreadError wxThread::Create()
}
#endif // HAVE_THREAD_PRIORITY_FUNCTIONS
#ifdef HAVE_PTHREAD_ATTR_SETSCOPE
// this will make the threads created by this process really concurrent
pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
#endif // HAVE_PTHREAD_ATTR_SETSCOPE
// create the new OS thread object
int rc = pthread_create(p_internal->GetIdPtr(), &attr,
wxThreadInternal::PthreadStart, (void *)this);
@ -737,10 +742,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxThreadModule, wxModule)
bool wxThreadModule::OnInit()
{
if ( pthread_key_create(&gs_keySelf, NULL /* dtor function */) != 0 )
int rc = pthread_key_create(&gs_keySelf, NULL /* dtor function */);
if ( rc != 0 )
{
wxLogError(_("Thread module initialization failed: "
"failed to create pthread key."));
wxLogSysError(rc, _("Thread module initialization failed: "
"failed to create thread key"));
return FALSE;
}