assert fail before allowing invalid thread id into use
This commit is contained in:
@@ -504,6 +504,7 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds )
|
||||
epicsShareFunc epicsThreadId epicsShareAPI epicsThreadGetIdSelf (void)
|
||||
{
|
||||
win32ThreadParam *pParm = (win32ThreadParam *) TlsGetValue (tlsIndexWIN32);
|
||||
assert ( pParm ); /* very dangerous to allow non-unique thread id into use */
|
||||
return (epicsThreadId) pParm;
|
||||
}
|
||||
|
||||
|
||||
@@ -445,6 +445,7 @@ void epicsThreadSleep(double seconds)
|
||||
|
||||
epicsThreadId epicsThreadGetIdSelf(void) {
|
||||
epicsThreadOSD *pthreadInfo = (epicsThreadOSD *)pthread_getspecific(getpthreadInfo);
|
||||
assert ( pthreadInfo ); /* very dangerous to allow non-unique thread id into use */
|
||||
return(pthreadInfo);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user