epicsThreadMustJoin() warn only on double self-join
This commit is contained in:
@@ -377,10 +377,16 @@ void epicsThreadMustJoin(epicsThreadId id)
|
||||
}
|
||||
|
||||
if(!v->joinable) {
|
||||
/* try to error nicely, however in all likelyhood rtems_task_get_note failed,
|
||||
* or gave us the wrong thread as we are racing thread exit.
|
||||
*/
|
||||
cantProceed("%s thread not joinable.\n", v->name);
|
||||
if(epicsThreadGetIdSelf()==id) {
|
||||
errlogPrintf("Warning: %s thread self-join of unjoinable\n", v->name);
|
||||
|
||||
} else {
|
||||
/* try to error nicely, however in all likelyhood de-ref of
|
||||
* 'id' has already caused SIGSEGV as we are racing thread exit,
|
||||
* which free's 'id'.
|
||||
*/
|
||||
cantProceed("Error: %s thread not joinable.\n", v->name);
|
||||
}
|
||||
return;
|
||||
|
||||
} else if(target_tid!=self_tid) {
|
||||
|
||||
@@ -669,11 +669,16 @@ void epicsThreadMustJoin(epicsThreadId id)
|
||||
if(!id) {
|
||||
/* no-op */
|
||||
} else if(!pParmWIN32->joinable) {
|
||||
/* try to error nicely, however in all likelyhood de-ref of
|
||||
* 'pParmWIN32' has already crashed us as we are racing thread exit,
|
||||
* which free's 'pParmWIN32'.
|
||||
*/
|
||||
cantProceed("%s thread not joinable.\n", pParmWIN32->pName);
|
||||
if(epicsThreadGetIdSelf()==id) {
|
||||
fprintf(stderr, "Warning: %s thread self-join of unjoinable\n", pParmWIN32->pName);
|
||||
|
||||
} else {
|
||||
/* try to error nicely, however in all likelyhood de-ref of
|
||||
* 'id' has already caused SIGSEGV as we are racing thread exit,
|
||||
* which free's 'id'.
|
||||
*/
|
||||
cantProceed("Error: %s thread not joinable.\n", pParmWIN32->pName);
|
||||
}
|
||||
return;
|
||||
|
||||
} else if(epicsThreadGetIdSelf() != id) {
|
||||
|
||||
@@ -608,11 +608,16 @@ void epicsThreadMustJoin(epicsThreadId id)
|
||||
if(!id) {
|
||||
return;
|
||||
} else if(!id->joinable) {
|
||||
/* try to error nicely, however in all likelyhood de-ref of
|
||||
* 'id' has already caused SIGSEGV as we are racing thread exit,
|
||||
* which free's 'id'.
|
||||
*/
|
||||
cantProceed("%s thread not joinable.\n", id->name);
|
||||
if(epicsThreadGetIdSelf()==id) {
|
||||
errlogPrintf("Warning: %s thread self-join of unjoinable\n", id->name);
|
||||
|
||||
} else {
|
||||
/* try to error nicely, however in all likelyhood de-ref of
|
||||
* 'id' has already caused SIGSEGV as we are racing thread exit,
|
||||
* which free's 'id'.
|
||||
*/
|
||||
cantProceed("Error: %s thread not joinable.\n", id->name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user