mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 819443 - Make sure we don't finalize on background thread (r=luke)
This commit is contained in:
parent
935ede40ea
commit
89f5ca56f4
@ -482,7 +482,11 @@ struct JSRuntime : js::RuntimeFriendFields
|
|||||||
void clearOwnerThread();
|
void clearOwnerThread();
|
||||||
void setOwnerThread();
|
void setOwnerThread();
|
||||||
JS_FRIEND_API(void) abortIfWrongThread() const;
|
JS_FRIEND_API(void) abortIfWrongThread() const;
|
||||||
|
#ifdef DEBUG
|
||||||
JS_FRIEND_API(void) assertValidThread() const;
|
JS_FRIEND_API(void) assertValidThread() const;
|
||||||
|
#else
|
||||||
|
void assertValidThread() const {}
|
||||||
|
#endif
|
||||||
private:
|
private:
|
||||||
void *ownerThread_;
|
void *ownerThread_;
|
||||||
public:
|
public:
|
||||||
|
@ -225,6 +225,9 @@ JSObject::finalize(js::FreeOp *fop)
|
|||||||
js::Probes::finalizeObject(this);
|
js::Probes::finalizeObject(this);
|
||||||
|
|
||||||
if (!IsBackgroundFinalized(getAllocKind())) {
|
if (!IsBackgroundFinalized(getAllocKind())) {
|
||||||
|
/* Assert we're on the main thread. */
|
||||||
|
fop->runtime()->assertValidThread();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finalize obj first, in case it needs map and slots. Objects with
|
* Finalize obj first, in case it needs map and slots. Objects with
|
||||||
* finalize hooks are not finalized in the background, as the class is
|
* finalize hooks are not finalized in the background, as the class is
|
||||||
|
Loading…
Reference in New Issue
Block a user