]> jfr.im git - irc/atheme/libmowgli-2.git/commitdiff
thread: gut Sun-specific implementation. origin/release/2.0
authorElizabeth J. Myers <redacted>
Mon, 23 Apr 2012 16:31:19 +0000 (11:31 -0500)
committerWilliam Pitcock <redacted>
Sun, 3 Jun 2012 05:33:43 +0000 (00:33 -0500)
Rationale for this is we don't work on an ancient SunOS systems anyway
because a C99 compiler is not available; modern Solaris systems have
pthreads.

src/libmowgli/thread/mutex.c
src/libmowgli/thread/posix_mutexops.c

index 1d5d4804e0bc7706e726bc9ef12456128b29a0f6..05a2f0592da985272f1a3e389ba31ba6459990ec 100644 (file)
@@ -25,8 +25,6 @@
 
 #if defined(_WIN32)
 extern const mowgli_mutex_ops_t _mowgli_win32_mutex_ops;
-#elif defined(_sun) || defined(_sco)
-extern const mowgli_mutex_ops_t _mowgli_sun_mutex_ops;
 #else
 extern const mowgli_mutex_ops_t _mowgli_posix_mutex_ops;
 #endif
@@ -45,10 +43,6 @@ static inline const mowgli_mutex_ops_t *get_mutex_platform(void)
        return &_mowgli_win32_mutex_ops;
 #endif
 
-#if defined(_sun) || defined(_sco)
-       return &_mowgli_sun_mutex_ops;
-#endif
-
 #if !defined(MOWGLI_FEATURE_HAVE_NATIVE_MUTEXES)
        return &_mowgli_posix_mutex_ops;
 #endif
index 5fb64e9f98fd18aa170bde2e9789363edc30160b..2fa1a766c2e78a6e8b3a19c93eb61f5af47de552 100644 (file)
 
 #ifndef _WIN32
 
-/*************
- * This implements native Sun/UnixWare threads.  Some other SVR4-based
- * environments attempted to make work-alikes, but those aren't guaranteed
- * to be supported.  This should work on SunOS 5.2 and UnixWare 7, and
- * anything later.
- *************/
-#if defined(__sun) || defined(__sco)
-
-static int mowgli_sun_mutex_create(mowgli_mutex_t *mutex)
-{
-       return mutex_init(&mutex->mutex, USYNC_THREAD, NULL);
-}
-
-static int mowgli_sun_mutex_lock(mowgli_mutex_t *mutex)
-{
-       return mutex_lock(&mutex->mutex);
-}
-
-static int mowgli_sun_mutex_trylock(mowgli_mutex_t *mutex)
-{
-       return mutex_trylock(&mutex->mutex);
-}
-
-static int mowgli_sun_mutex_unlock(mowgli_mutex_t *mutex)
-{
-       return mutex_unlock(&mutex->mutex);
-}
-
-static int mowgli_sun_mutex_destroy(mowgli_mutex_t *mutex)
-{
-       return mutex_destroy(&mutex->mutex);
-}
-
-const mowgli_mutex_ops_t _mowgli_sun_mutex_ops = {
-       .mutex_create = mowgli_sun_mutex_create,
-       .mutex_lock = mowgli_sun_mutex_lock,
-       .mutex_trylock = mowgli_sun_mutex_trylock,
-       .mutex_unlock = mowgli_sun_mutex_unlock,
-       .mutex_destroy = mowgli_sun_mutex_destroy,
-};
-
 /*************
  * This "default" implementation uses pthreads.  Care has been taken to
  * ensure it runs on POSIX 1003.4a (draft 4, aka DECthreads, aka what OSF/1,
@@ -75,7 +34,7 @@ const mowgli_mutex_ops_t _mowgli_sun_mutex_ops = {
  * it should be relatively easy to maintian d4 compatibility without
  * sacrificing any functionality.
  *************/
-#elif !defined(MOWGLI_FEATURE_HAVE_NATIVE_MUTEXES)
+#if !defined(MOWGLI_FEATURE_HAVE_NATIVE_MUTEXES)
 
 static int mowgli_posix_mutex_create(mowgli_mutex_t *mutex)
 {