Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / dos / attemptlockdoslist.c
blobc93bb89cdb5c2301f0ed0af441d1d785ec81d6da
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
8 #include <proto/exec.h>
9 #include "dos_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH1(struct DosList *, AttemptLockDosList,
18 /* SYNOPSIS */
19 AROS_LHA(ULONG, flags, D1),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 111, Dos)
24 /* FUNCTION
25 Tries to get a lock on some of the dos lists. If all went
26 well a handle is returned that can be used for FindDosEntry().
27 Don't try to busy wait until the lock can be granted - use
28 LockDosList() instead.
30 INPUTS
31 flags -- what lists to lock
33 RESULT
34 Handle to the dos list or NULL. This is not a direct pointer
35 to the first list element but to a pseudo element instead.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
50 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
52 if(flags & LDF_WRITE)
54 if(!AttemptSemaphore(&DOSBase->dl_DosListLock))
55 return NULL;
57 else
59 if(!AttemptSemaphoreShared(&DOSBase->dl_DosListLock))
60 return NULL;
63 return (struct DosList *)&DOSBase->dl_DevInfo;
65 AROS_LIBFUNC_EXIT
66 } /* AttemptLockDosList */