Closed Ms2ger closed 7 years ago
Why not put the TLS thing in servo/servo? Why forbid the creation of two unrelated runtimes on a single thread?
Why forbid the creation of two unrelated runtimes on a single thread?
SpiderMonkey requires a 1:1 relationship between a JSRuntime
and its thread.
@fitzgen Thanks!
@Ms2ger Could you make ::get()
panic if the pointer is null?
@bors-servo r+
:pushpin: Commit c8ebc6d has been approved by nox
:hourglass: Testing commit c8ebc6d with merge 1941f1c...
:sunny: Test successful - status-appveyor, status-travis
I still believe that was the wrong way to go, because now if we want to use the Runtime
value and Runtime::get
to do safe abstractions around for example ToJsValConvertible
, we still won't be able to avoid some unsafe code in servo for dereferencing the result of Runtime::get
, whereas we could make it be owned by TLS if it were done in servo instead of here.
This change is