Print this page
remove support for non-ANSI compilation

Split Close
Expand all
Collapse all
          --- old/usr/src/head/synch.h
          +++ new/usr/src/head/synch.h
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
       23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  23   24   * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
  24   25   */
  25   26  
  26   27  #ifndef _SYNCH_H
  27   28  #define _SYNCH_H
  28   29  
  29   30  /*
  30   31   * synch.h:
  31   32   * definitions needed to use the thread synchronization interface
  32   33   */
↓ open down ↓ 46 lines elided ↑ open up ↑
  79   80   */
  80   81  typedef struct _rwlock {
  81   82          int32_t         readers;        /* rwstate word */
  82   83          uint16_t        type;
  83   84          uint16_t        magic;
  84   85          mutex_t         mutex;          /* used with process-shared rwlocks */
  85   86          cond_t          readercv;       /* used only to indicate ownership */
  86   87          cond_t          writercv;       /* used only to indicate ownership */
  87   88  } rwlock_t;
  88   89  
  89      -#ifdef  __STDC__
  90   90  int     _lwp_mutex_lock(lwp_mutex_t *);
  91   91  int     _lwp_mutex_unlock(lwp_mutex_t *);
  92   92  int     _lwp_mutex_trylock(lwp_mutex_t *);
  93   93  int     _lwp_cond_wait(lwp_cond_t *, lwp_mutex_t *);
  94   94  int     _lwp_cond_timedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *);
  95   95  int     _lwp_cond_reltimedwait(lwp_cond_t *, lwp_mutex_t *, timespec_t *);
  96   96  int     _lwp_cond_signal(lwp_cond_t *);
  97   97  int     _lwp_cond_broadcast(lwp_cond_t *);
  98   98  int     _lwp_sema_init(lwp_sema_t *, int);
  99   99  int     _lwp_sema_wait(lwp_sema_t *);
↓ open down ↓ 20 lines elided ↑ open up ↑
 120  120  int     rw_tryrdlock(rwlock_t *);
 121  121  int     rw_trywrlock(rwlock_t *);
 122  122  int     sema_init(sema_t *, unsigned int, int, void *);
 123  123  int     sema_destroy(sema_t *);
 124  124  int     sema_wait(sema_t *);
 125  125  int     sema_timedwait(sema_t *, const timespec_t *);
 126  126  int     sema_reltimedwait(sema_t *, const timespec_t *);
 127  127  int     sema_post(sema_t *);
 128  128  int     sema_trywait(sema_t *);
 129  129  
 130      -#else   /* __STDC__ */
 131      -
 132      -int     _lwp_mutex_lock();
 133      -int     _lwp_mutex_unlock();
 134      -int     _lwp_mutex_trylock();
 135      -int     _lwp_cond_wait();
 136      -int     _lwp_cond_timedwait();
 137      -int     _lwp_cond_reltimedwait();
 138      -int     _lwp_cond_signal();
 139      -int     _lwp_cond_broadcast();
 140      -int     _lwp_sema_init();
 141      -int     _lwp_sema_wait();
 142      -int     _lwp_sema_trywait();
 143      -int     _lwp_sema_post();
 144      -int     cond_init();
 145      -int     cond_destroy();
 146      -int     cond_wait();
 147      -int     cond_timedwait();
 148      -int     cond_reltimedwait();
 149      -int     cond_signal();
 150      -int     cond_broadcast();
 151      -int     mutex_init();
 152      -int     mutex_destroy();
 153      -int     mutex_consistent();
 154      -int     mutex_lock();
 155      -int     mutex_trylock();
 156      -int     mutex_unlock();
 157      -int     rwlock_init();
 158      -int     rwlock_destroy();
 159      -int     rw_rdlock();
 160      -int     rw_wrlock();
 161      -int     rw_unlock();
 162      -int     rw_tryrdlock();
 163      -int     rw_trywrlock();
 164      -int     sema_init();
 165      -int     sema_destroy();
 166      -int     sema_wait();
 167      -int     sema_timedwait();
 168      -int     sema_reltimedwait();
 169      -int     sema_post();
 170      -int     sema_trywait();
 171      -
 172      -#endif  /* __STDC__ */
 173      -
 174  130  #endif /* _ASM */
 175  131  
 176  132  /* "Magic numbers" tagging synchronization object types */
 177  133  #define MUTEX_MAGIC     _MUTEX_MAGIC
 178  134  #define SEMA_MAGIC      _SEMA_MAGIC
 179  135  #define COND_MAGIC      _COND_MAGIC
 180  136  #define RWL_MAGIC       _RWL_MAGIC
 181  137  
 182  138  /*
 183  139   * POSIX.1c Note:
↓ open down ↓ 47 lines elided ↑ open up ↑
 231  187   */
 232  188  #ifndef NO_LOCKS_HELD
 233  189  #define NO_LOCKS_HELD   1
 234  190  #endif
 235  191  #ifndef NO_COMPETING_THREADS
 236  192  #define NO_COMPETING_THREADS    1
 237  193  #endif
 238  194  
 239  195  #ifndef _ASM
 240  196  
 241      -#ifdef  __STDC__
 242      -
 243  197  /*
 244  198   * The *_held() functions apply equally well to Solaris threads
 245  199   * and to Posix threads synchronization objects, but the formal
 246  200   * type declarations are different, so we just declare the argument
 247  201   * to each *_held() function to be a void *, expecting that they will
 248  202   * be called with the proper type of argument in each case.
 249  203   */
 250  204  int _sema_held(void *);                 /* sema_t or sem_t */
 251  205  int _rw_read_held(void *);              /* rwlock_t or pthread_rwlock_t */
 252  206  int _rw_write_held(void *);             /* rwlock_t or pthread_rwlock_t */
 253  207  int _mutex_held(void *);                /* mutex_t or pthread_mutex_t */
 254  208  
 255      -#else   /* __STDC__ */
 256      -
 257      -int _sema_held();
 258      -int _rw_read_held();
 259      -int _rw_write_held();
 260      -int _mutex_held();
 261      -
 262      -#endif  /* __STDC__ */
 263      -
 264  209  /* Pause API */
 265      -#ifdef  __STDC__
 266  210  void smt_pause(void);
 267      -#else   /* __STDC__ */
 268      -void smt_pause();
 269      -#endif  /* __STDC__ */
 270  211  
 271  212  #endif /* _ASM */
 272  213  
 273  214  #ifdef  __cplusplus
 274  215  }
 275  216  #endif
 276  217  
 277  218  #endif  /* _SYNCH_H */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX