diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-04 15:36:32 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-05 19:39:56 -0800 |
| commit | 4c4a2320eb9620dbc68a264ce64ee1f233dd977d (patch) | |
| tree | 906d11b31ca849c4d4a6ef0ca176dd46118e84be /src/rt/rust_port.cpp | |
| parent | 0a5603cb58bdc66ad6b6a030e4e98ebeb3c13721 (diff) | |
| download | rust-4c4a2320eb9620dbc68a264ce64ee1f233dd977d.tar.gz rust-4c4a2320eb9620dbc68a264ce64ee1f233dd977d.zip | |
rt: Make rust_port_detach less contentious
It still utterly dominates some benchmarks with busy waiting, but at least it doesn't create lock contention while doing so.
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index bbfa737adec..628d3d70d18 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -25,8 +25,7 @@ void rust_port::detach() { // FIXME: Busy waiting until we're the only ref bool done = false; while (!done) { - scoped_lock with(task->port_lock); - done = ref_count == 1; + done = get_ref_count() == 1; } } |
