home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / exec / releasesemaphorelist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.6 KB  |  79 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: releasesemaphorelist.c,v 1.5 1996/10/24 15:50:55 aros Exp $
  4.     $Log: releasesemaphorelist.c,v $
  5.     Revision 1.5  1996/10/24 15:50:55  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:06  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:16  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include "exec_intern.h"
  20. #include "semaphores.h"
  21.  
  22. /*****************************************************************************
  23.  
  24.     NAME */
  25.     #include <exec/semaphores.h>
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(void, ReleaseSemaphoreList,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct List *, sigSem, A0),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 98, Exec)
  35.  
  36. /*  FUNCTION
  37.     This function releases all semaphores in the list at once.
  38.  
  39.     INPUTS
  40.     sigSem - pointer to list full of semaphores
  41.  
  42.     RESULT
  43.  
  44.     NOTES
  45.  
  46.     EXAMPLE
  47.  
  48.     BUGS
  49.  
  50.     SEE ALSO
  51.  
  52.     INTERNALS
  53.  
  54.     HISTORY
  55.  
  56. *****************************************************************************/
  57. {
  58.     AROS_LIBFUNC_INIT
  59.     struct Node *n;
  60.  
  61.     /*
  62.     There's no arbitration needed - the first semaphore in the list
  63.     arbitrates for the full list.
  64.     Get first element in the list.
  65.     */
  66.     n=sigSem->lh_Head;
  67.  
  68.     /* And follow it. */
  69.     while(n->ln_Succ!=NULL)
  70.     {
  71.     /* Free the semaphore */
  72.     ObtainSemaphore((struct SignalSemaphore *)n);
  73.  
  74.     /* Get next element */
  75.     n=n->ln_Succ;
  76.     }
  77.     AROS_LIBFUNC_EXIT
  78. } /* ReleaseSemaphoreList */
  79.