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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: lockdoslist.c,v 1.4 1996/10/24 15:50:32 aros Exp $
  4.     $Log: lockdoslist.c,v $
  5.     Revision 1.4  1996/10/24 15:50:32  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.3  1996/08/13 13:52:48  digulla
  9.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  10.     Replaced AROS_LA by AROS_LHA
  11.  
  12.     Revision 1.2  1996/08/01 17:40:54  digulla
  13.     Added standard header for all files
  14.  
  15.     Desc:
  16.     Lang: english
  17. */
  18. #include <clib/exec_protos.h>
  19. #include "dos_intern.h"
  20.  
  21. /*****************************************************************************
  22.  
  23.     NAME */
  24.     #include <clib/dos_protos.h>
  25.  
  26.     AROS_LH1(struct DosList *, LockDosList,
  27.  
  28. /*  SYNOPSIS */
  29.     AROS_LHA(ULONG, flags, D1),
  30.  
  31. /*  LOCATION */
  32.     struct DosLibrary *, DOSBase, 109, Dos)
  33.  
  34. /*  FUNCTION
  35.     Waits until the desired dos lists are free then gets a lock on them.
  36.     A handle is returned that can be used for FindDosEntry().
  37.     Calls to this function nest, i.e. you must call UnLockDosList()
  38.     as often as you called LockDosList(). Always lock all lists
  39.     at once - do not try to get a lock on one of them then on another.
  40.  
  41.     INPUTS
  42.     flags - what lists to lock
  43.  
  44.     RESULT
  45.     Handle to the dos list. This is not a direct pointer
  46.     to the first list element but to a pseudo element instead.
  47.  
  48.     NOTES
  49.  
  50.     EXAMPLE
  51.  
  52.     BUGS
  53.  
  54.     SEE ALSO
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.     29-10-95    digulla automatically created from
  60.                 dos_lib.fd and clib/dos_protos.h
  61.  
  62. *****************************************************************************/
  63. {
  64.     AROS_LIBFUNC_INIT
  65.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  66.     if(flags&LDF_WRITE)
  67.     ObtainSemaphore(&DOSBase->dl_DosListLock);
  68.     else
  69.     ObtainSemaphoreShared(&DOSBase->dl_DosListLock);
  70.     return (struct DosList *)&DOSBase->dl_DevInfo;
  71.     AROS_LIBFUNC_EXIT
  72. } /* LockDosList */
  73.