diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-05-02 20:51:56 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-05-02 20:51:56 -0700 |
| commit | 6c478c7de889ec4943b9dcdcbfbb8a8244f479cc (patch) | |
| tree | 7f9fd01150a7611007255cbb2e45cf41e0cd4989 /src/rt/rust_test_helpers.cpp | |
| parent | baa1c1834f608c8c789db6d2495626ff9d28dd96 (diff) | |
| parent | f8dffc6789113a10c9dbf1d815c3569b19b53e96 (diff) | |
| download | rust-6c478c7de889ec4943b9dcdcbfbb8a8244f479cc.tar.gz rust-6c478c7de889ec4943b9dcdcbfbb8a8244f479cc.zip | |
Merge remote-tracking branch 'brson/io' into incoming
Conflicts: mk/rt.mk src/libcore/run.rs
Diffstat (limited to 'src/rt/rust_test_helpers.cpp')
| -rw-r--r-- | src/rt/rust_test_helpers.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rt/rust_test_helpers.cpp b/src/rt/rust_test_helpers.cpp index 64966bd3454..d82c39d6838 100644 --- a/src/rt/rust_test_helpers.cpp +++ b/src/rt/rust_test_helpers.cpp @@ -165,3 +165,14 @@ extern "C" CDECL TwoDoubles rust_dbg_extern_identity_TwoDoubles(TwoDoubles u) { return u; } + +// Generates increasing port numbers for network testing +extern "C" CDECL uintptr_t +rust_dbg_next_port() { + static lock_and_signal dbg_port_lock; + static uintptr_t next_port = 9600; + scoped_lock with(dbg_port_lock); + uintptr_t this_port = next_port; + next_port += 1; + return this_port; +} |
