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

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: attemptlockdoslist.c,v 1.4 1996/10/24 15:50:24 aros Exp $
  4.     $Log: attemptlockdoslist.c,v $
  5.     Revision 1.4  1996/10/24 15:50:24  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.3  1996/08/13 13:52:44  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:47  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 *, AttemptLockDosList,
  27.  
  28. /*  SYNOPSIS */
  29.     AROS_LHA(ULONG, flags, D1),
  30.  
  31. /*  LOCATION */
  32.     struct DosLibrary *, DOSBase, 111, Dos)
  33.  
  34. /*  FUNCTION
  35.     Tries to get a lock on some of the dos lists. If all went
  36.     well a handle is returned that can be used for FindDosEntry().
  37.     Don't try to busy wait until the lock can be granted - use
  38.     LockDosList() instead.
  39.  
  40.     INPUTS
  41.     flags - what lists to lock
  42.  
  43.     RESULT
  44.     Handle to the dos list or NULL. This is not a direct pointer
  45.     to the first list element but to a pseudo element instead.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.     29-10-95    digulla automatically created from
  59.                 dos_lib.fd and clib/dos_protos.h
  60.  
  61. *****************************************************************************/
  62. {
  63.     AROS_LIBFUNC_INIT
  64.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  65.     if(flags&LDF_WRITE)
  66.     {
  67.     if(!AttemptSemaphore(&DOSBase->dl_DosListLock))
  68.         return NULL;
  69.     }else
  70.     if(!AttemptSemaphoreShared(&DOSBase->dl_DosListLock))
  71.         return NULL;
  72.     return (struct DosList *)&DOSBase->dl_DevInfo;
  73.     AROS_LIBFUNC_EXIT
  74. } /* AttemptLockDosList */
  75.