Closed nox closed 6 years ago
@nox: Gecko may call the NetworkResource functions from a number of different threads, so on the face of it, this seems reasonable, but is it really necessary? How does this contribute to make NetworkResource impls thread safe? Is mpsc::Sender<> not internally threadsafe? Given that it's used to send messages between threads, I'd have assumed it internally took a lock when it accessed the message queue on its matching Receiver.
Sender<T>
isn't Sync
, that's why the mutex is needed.
Ah, so Sender isn't Sync itself, so we need the Mutex to make it Sync, to protect its other state I suppose.
@bors-servo r=cpearce
:pushpin: Commit 36de5a5 has been approved by cpearce
:hourglass: Testing commit 36de5a527ac02886cb9ddfdd98c1def9b6a373c2 with merge 1e3fbf22c5f4a893f3d7387fcd8a076d5ac13ef6...
:broken_heart: Test failed - status-travis
:sunny: Test successful - status-travis Approved by: cpearce Pushing 1e3fbf22c5f4a893f3d7387fcd8a076d5ac13ef6 to master...
@cpearce r?