home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / rom / dos / lockdoslist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  2.0 KB  |  81 lines

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