Don't require external use of internal enum smb_thread_lock_type
authorDerrell Lipman <derrell@dworkin.(none)>
Mon, 11 May 2009 02:27:54 +0000 (22:27 -0400)
committerDerrell Lipman <derrell@dworkin.(none)>
Mon, 11 May 2009 02:45:12 +0000 (22:45 -0400)
- Internally, when locking or unlocking a mutex, we'll pass one of the
  values of enum smb_thread_lock_type. That enum is not available to users
  providing a thread implementation. Externally, we'll document the integer
  values which will be passed to their lock_mutex function, but not require
  them to access our internal header file.

Derrell

lib/util/smb_threads.h

index f1a39a6e281894655951dfcb55fe585c1962776c..012b61c1ed3c6cec110f3986326e72edfafbb221 100644 (file)
@@ -37,8 +37,9 @@ struct smb_thread_functions {
                        const char *location);
        void (*destroy_mutex)(void *plock,
                        const char *location);
                        const char *location);
        void (*destroy_mutex)(void *plock,
                        const char *location);
-       int (*lock_mutex)(void *plock, enum smb_thread_lock_type lock_type,
-                       const char *location);
+       int (*lock_mutex)(void *plock,
+                          int lock_type,
+                          const char *location);
 
        /* Thread local storage. */
        int (*create_tls)(const char *keyname,
 
        /* Thread local storage. */
        int (*create_tls)(const char *keyname,
@@ -76,7 +77,7 @@ static void smb_destroy_mutex_pthread(void *plock, const char *location) \
        free(plock); \
 } \
  \
        free(plock); \
 } \
  \
-static int smb_lock_pthread(void *plock, enum smb_thread_lock_type lock_type, const char *location) \
+static int smb_lock_pthread(void *plock, int lock_type, const char *location) \
 { \
        if (lock_type == SMB_THREAD_UNLOCK) { \
                return pthread_mutex_unlock((pthread_mutex_t *)plock); \
 { \
        if (lock_type == SMB_THREAD_UNLOCK) { \
                return pthread_mutex_unlock((pthread_mutex_t *)plock); \