Print this page
4829 sema_init(3C) botches the arguments in an example

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/semaphore.3c
          +++ new/usr/src/man/man3c/semaphore.3c
↓ open down ↓ 98 lines elided ↑ open up ↑
  99   99  A semaphore must not be simultaneously initialized by multiple threads, nor
 100  100  re-initialized while in use by other threads.
 101  101  .sp
 102  102  .LP
 103  103  Default semaphore initialization (intra-process):
 104  104  .sp
 105  105  .in +2
 106  106  .nf
 107  107  sema_t sp;
 108  108  int count  =  1;
 109      -sema_init(&sp, count, NULL, NULL);
      109 +sema_init(&sp, count, 0, NULL);
 110  110  .fi
 111  111  .in -2
 112  112  
 113  113  .sp
 114  114  .LP
 115  115  or
 116  116  .sp
 117  117  .in +2
 118  118  .nf
 119  119  sema_init(&sp, count, USYNC_THREAD, NULL);
↓ open down ↓ 189 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX