/[hurd]/hurd/libpthread/sysdeps/generic/bits/mutex.h
ViewVC logotype

Diff of /hurd/libpthread/sysdeps/generic/bits/mutex.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by neal, Tue Jan 18 09:57:35 2005 UTC revision 1.3 by neal, Thu May 12 20:55:38 2005 UTC
# Line 1  Line 1 
1  /* Mutex type.  Generic version.  /* Mutex type.  Generic version.
2     Copyright (C) 2000,02 Free Software Foundation, Inc.     Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc.
3     This file is part of the GNU C Library.     This file is part of the GNU C Library.
4    
5     The GNU C Library is free software; you can redistribute it and/or     The GNU C Library is free software; you can redistribute it and/or
# Line 52  struct __pthread_mutex Line 52  struct __pthread_mutex
52  /* Initializer for a mutex.  N.B.  this also happens to be compatible  /* Initializer for a mutex.  N.B.  this also happens to be compatible
53     with the cthread mutex initializer.  */     with the cthread mutex initializer.  */
54  #  define __PTHREAD_MUTEX_INITIALIZER \  #  define __PTHREAD_MUTEX_INITIALIZER \
55      ((struct __pthread_mutex) \      { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, 0, 0, 0, 0, 0, 0 }
       { __SPIN_LOCK_INITIALIZER, __SPIN_LOCK_INITIALIZER, NULL, NULL, NULL, \  
         NULL, 0, 0 })  
56    
57  # endif  # endif
58  #endif /* Not __pthread_mutex_defined.  */  #endif /* Not __pthread_mutex_defined.  */
# Line 74  _EXTERN_INLINE int Line 72  _EXTERN_INLINE int
72  pthread_mutex_init (struct __pthread_mutex *__mutex,  pthread_mutex_init (struct __pthread_mutex *__mutex,
73                      const pthread_mutexattr_t *attr)                      const pthread_mutexattr_t *attr)
74  {  {
75      struct __pthread_mutex initialized_mutex = __PTHREAD_MUTEX_INITIALIZER;
76    
77    extern int _pthread_mutex_init (struct __pthread_mutex *,    extern int _pthread_mutex_init (struct __pthread_mutex *,
78                                    const pthread_mutexattr_t *);                                    const pthread_mutexattr_t *);
79    
80    if (attr)    if (attr)
81      return _pthread_mutex_init (__mutex, attr);      return _pthread_mutex_init (__mutex, attr);
82    
83    *__mutex = __PTHREAD_MUTEX_INITIALIZER;    *__mutex = initialized_mutex;
84    return 0;    return 0;
85  }  }
86    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26