/[hurd]/hurd/libpthread/sysdeps/generic/pt-barrier-init.c
ViewVC logotype

Diff of /hurd/libpthread/sysdeps/generic/pt-barrier-init.c

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

revision 1.1 by neal, Thu Oct 10 23:05:06 2002 UTC revision 1.2 by neal, Thu May 12 20:55:38 2005 UTC
# Line 1  Line 1 
1  /* pthread_barrier_init.  Generic version.  /* pthread_barrier_init.  Generic version.
2     Copyright (C) 2002 Free Software Foundation, Inc.     Copyright (C) 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 28  pthread_barrier_init (pthread_barrier_t Line 28  pthread_barrier_init (pthread_barrier_t
28                        const pthread_barrierattr_t *attr,                        const pthread_barrierattr_t *attr,
29                        unsigned count)                        unsigned count)
30  {  {
   assert (attr->pshared == PTHREAD_PROCESS_PRIVATE);  
   
31    if (count == 0)    if (count == 0)
32      return EINVAL;      return EINVAL;
33    
# Line 39  pthread_barrier_init (pthread_barrier_t Line 37  pthread_barrier_init (pthread_barrier_t
37    barrier->pending = count;    barrier->pending = count;
38    barrier->count = count;    barrier->count = count;
39    
40      if (! attr
41          || memcmp (attr, &__pthread_default_barrierattr, sizeof (*attr) == 0))
42        /* Use the default attributes.  */
43        return 0;
44    
45      /* Non-default attributes.  */
46    
47      barrier->attr = malloc (sizeof *attr);
48      if (! barrier->attr)
49        return ENOMEM;
50    
51      *barrier->attr = *attr;
52    return 0;    return 0;
53  }  }

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

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