No subject


Tue Aug 30 17:20:58 CDT 2005


/* Mutexes (not abstract because of
PTHREAD_MUTEX_INITIALIZER).  */
/* (The layout is unnatural to maintain binary
compatibility
    with earlier releases of LinuxThreads.) */
typedef struct
{
  int __m_reserved;               /* Reserved for
future use */
  int __m_count;                  /* Depth of
recursive locking */
  _pthread_descr __m_owner;       /* Owner thread (if
recursive or errcheck) */
  int __m_kind;                   /* Mutex kind: fast,
recursive or errcheck */
  struct _pthread_fastlock __m_lock; /* Underlying
fast lock */
} pthread_mutex_t;

#define PTHREAD_MUTEX_INITIALIZER \
  {0, 0, 0, PTHREAD_MUTEX_TIMED_NP,
__LOCK_INITIALIZER}

 
What WINE uses (scheduler/pthread.c):

/* assume that pthread_mutex_t has room for at least
one pointer,
 * and hope that the users of pthread_mutex_t
considers it opaque
 * (never checks what's in it) */
typedef struct {
  CRITICAL_SECTION *critsect;
} *wine_mutex;



rwlocks on the other hand are not so lucky as there's
no unused bits:



More information about the wine-devel mailing list