about summary refs log tree commit diff
path: root/src/rt/rust_test_helpers.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rt/rust_test_helpers.cpp')
-rw-r--r--src/rt/rust_test_helpers.cpp48
1 files changed, 1 insertions, 47 deletions
diff --git a/src/rt/rust_test_helpers.cpp b/src/rt/rust_test_helpers.cpp
index 631745e656a..bf5fb059e76 100644
--- a/src/rt/rust_test_helpers.cpp
+++ b/src/rt/rust_test_helpers.cpp
@@ -10,7 +10,7 @@
 
 // Helper functions used only in tests
 
-#include "sync/lock_and_signal.h"
+#include "rust_globals.h"
 
 // These functions are used in the unit tests for C ABI calls.
 
@@ -34,41 +34,6 @@ rust_dbg_extern_identity_u8(char u) {
     return u;
 }
 
-extern "C" CDECL lock_and_signal *
-rust_dbg_lock_create() {
-    return new lock_and_signal();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_destroy(lock_and_signal *lock) {
-    assert(lock);
-    delete lock;
-}
-
-extern "C" CDECL void
-rust_dbg_lock_lock(lock_and_signal *lock) {
-    assert(lock);
-    lock->lock();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_unlock(lock_and_signal *lock) {
-    assert(lock);
-    lock->unlock();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_wait(lock_and_signal *lock) {
-    assert(lock);
-    lock->wait();
-}
-
-extern "C" CDECL void
-rust_dbg_lock_signal(lock_and_signal *lock) {
-    assert(lock);
-    lock->signal();
-}
-
 typedef void *(*dbg_callback)(void*);
 
 extern "C" CDECL void *
@@ -160,17 +125,6 @@ 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(uintptr_t base_port) {
-  static lock_and_signal dbg_port_lock;
-  static uintptr_t next_offset = 0;
-  scoped_lock with(dbg_port_lock);
-  uintptr_t this_port = base_port + next_offset;
-  next_offset += 1;
-  return this_port;
-}
-
 extern "C" CDECL intptr_t
 rust_get_test_int() {
   return 1;