mirror of https://github.com/PCSX2/pcsx2.git
utilities: Split thread internal callback function
__try is used in pthread_cleanup_push when CLEANUP_SEH is used as the
pthread cleanup model. That can't be used in functions with objects
that have destructors, so move it into a separate function.
Fixes a non-release build compile error on Windows. Regression was
introduced in 93d5b52df3
.
This commit is contained in:
parent
6b2fcbd070
commit
f3e78b8267
|
@ -200,6 +200,7 @@ protected:
|
|||
void _ThreadCleanup();
|
||||
|
||||
static void *_internal_callback(void *func);
|
||||
static void internal_callback_helper(void *func);
|
||||
static void _pt_callback_cleanup(void *handle);
|
||||
};
|
||||
|
||||
|
|
|
@ -685,12 +685,21 @@ void *Threading::pxThread::_internal_callback(void *itsme)
|
|||
{
|
||||
if (!pxAssertDev(itsme != NULL, wxNullChar))
|
||||
return NULL;
|
||||
pxThread &owner = *((pxThread *)itsme);
|
||||
|
||||
internal_callback_helper(itsme);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// __try is used in pthread_cleanup_push when CLEANUP_SEH is used as the cleanup model.
|
||||
// That can't be used in a function that has objects that require unwinding (compile
|
||||
// error C2712), so move it into a separate function.
|
||||
void Threading::pxThread::internal_callback_helper(void *itsme)
|
||||
{
|
||||
pxThread &owner = *static_cast<pxThread *>(itsme);
|
||||
|
||||
pthread_cleanup_push(_pt_callback_cleanup, itsme);
|
||||
owner._internal_execute();
|
||||
pthread_cleanup_pop(true);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Threading::pxThread::_DoSetThreadName(const wxString &name)
|
||||
|
|
Loading…
Reference in New Issue