diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-13 15:28:59 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-13 15:43:58 -0800 |
| commit | 138d9ca5d536a67465f8b97bee12a0c24b9e3233 (patch) | |
| tree | 85ddf5f24b70f65556bd1f597c4797a428798f74 /src/rt/rust_port.cpp | |
| parent | 3cc2641fc389dcdf8b348c1a9dbc6dfe48c5547a (diff) | |
| download | rust-138d9ca5d536a67465f8b97bee12a0c24b9e3233.tar.gz rust-138d9ca5d536a67465f8b97bee12a0c24b9e3233.zip | |
Drop enqueued elements when a port is destructed. Closes #1155
Diffstat (limited to 'src/rt/rust_port.cpp')
| -rw-r--r-- | src/rt/rust_port.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rt/rust_port.cpp b/src/rt/rust_port.cpp index 5daf5e40033..ff743eeeb40 100644 --- a/src/rt/rust_port.cpp +++ b/src/rt/rust_port.cpp @@ -48,6 +48,11 @@ bool rust_port::receive(void *dptr) { return false; } +size_t rust_port::size() { + scoped_lock with(lock); + return buffer.size(); +} + void rust_port::log_state() { LOG(task, comm, "port size: %d", |
