Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added space before * for consistency

...

Code Block
bgColor#ccccff
/* initialization of Pthread attribute objects */
int pthread_condattr_init(pthread_condattr_t *);
int pthread_mutexattr_init(pthread_mutexattr_t *);
int pthread_rwlockattr_init(pthread_rwlockattr_t *);
...
/* initialization of Pthread objects using attributes */
int pthread_cond_init(pthread_cond_t * restrict, const pthread_condattr_t * restrict);
int pthread_mutex_init(pthread_mutex_t * restrict, const pthread_mutexattr_t * restrict);
int pthread_rwlock_init(pthread_rwlock_t * restrict, const pthread_rwlockattr_t * restrict);
...

Function arguments that refer to objects that aren't modified are declared const. Since Because the object pointed to by the first argument is modified by the function, it is not const. For functions that implement a data abstraction (see DCL12-C. Implement abstract data types using opaque types), it is reasonable to define the handle for the data abstraction as the initial parameter. Finally, initialization functions that accept a pointer to an attribute object allow it to be NULL as an indication that a reasonable default be used.

...