From 180f3edafd9d9a8bfd8eb0cb16a7850629063fb2 Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Wed, 19 Apr 2006 06:47:15 +0000 Subject: [PATCH] Enable build of RPC code without pthreads (for Basilisk II and SheepShaver) since we use our own custom message dispatch loop --- BasiliskII/src/Unix/rpc_unix.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/BasiliskII/src/Unix/rpc_unix.cpp b/BasiliskII/src/Unix/rpc_unix.cpp index 461eb0c8..d90824b6 100644 --- a/BasiliskII/src/Unix/rpc_unix.cpp +++ b/BasiliskII/src/Unix/rpc_unix.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include "rpc.h" @@ -54,6 +53,31 @@ #endif +/* ====================================================================== */ +/* === PThreads Glue === */ +/* ====================================================================== */ + +//#define USE_THREADS + +#ifndef USE_THREADS +#define pthread_t void * +#define pthread_cancel(th) +#define pthread_join(th, ret) +#define pthread_testcancel() +#define pthread_create(th, attr, start, arg) dummy_thread_create() +static inline int dummy_thread_create(void) { errno = ENOSYS; return -1; } + +#undef pthread_mutex_t +#define pthread_mutex_t volatile int +#undef pthread_mutex_lock +#define pthread_mutex_lock(m) -1 +#undef pthread_mutex_unlock +#define pthread_mutex_unlock(m) -1 +#undef PTHREAD_MUTEX_INITIALIZER +#define PTHREAD_MUTEX_INITIALIZER 0 +#endif + + /* ====================================================================== */ /* === RPC Connection Handling === */ /* ====================================================================== */ @@ -362,6 +386,7 @@ int rpc_listen_socket(rpc_connection_t *connection) } // Listen for incoming messages on RPC connection +#ifdef USE_THREADS int rpc_listen(rpc_connection_t *connection) { D(bug("rpc_listen\n")); @@ -373,6 +398,7 @@ int rpc_listen(rpc_connection_t *connection) return RPC_ERROR_NO_ERROR; } +#endif /* ====================================================================== */