Use taskIdSelf() function instead of taskIdCurrent global variable

The uniprocessor taskIdCurrent global variable (declared in taskLib.h)
does not exist in VxWorks SMP, because of concurrent execution on
multiple CPUs. Any uniprocessor code that reads taskIdCurrent should
make calls to taskIdSelf() instead.

Change-Id: I4e0efef32297f339d6121c7d4bca3820e0fc9294
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Pasi Petäjäjärvi 2012-06-15 14:30:15 +03:00 committed by The Qt Project
parent baad50e979
commit 608cd1ad84

View File

@ -113,7 +113,7 @@ QEventDispatcherUNIXPrivate::QEventDispatcherUNIXPrivate()
} }
#elif defined(Q_OS_VXWORKS) #elif defined(Q_OS_VXWORKS)
char name[20]; char name[20];
qsnprintf(name, sizeof(name), "/pipe/qt_%08x", int(taskIdCurrent)); qsnprintf(name, sizeof(name), "/pipe/qt_%08x", int(taskIdSelf()));
// make sure there is no pipe with this name // make sure there is no pipe with this name
pipeDevDelete(name, true); pipeDevDelete(name, true);
@ -159,7 +159,7 @@ QEventDispatcherUNIXPrivate::~QEventDispatcherUNIXPrivate()
close(thread_pipe[0]); close(thread_pipe[0]);
char name[20]; char name[20];
qsnprintf(name, sizeof(name), "/pipe/qt_%08x", int(taskIdCurrent)); qsnprintf(name, sizeof(name), "/pipe/qt_%08x", int(taskIdSelf()));
pipeDevDelete(name, true); pipeDevDelete(name, true);
#else #else