2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include "dos_intern.h"
10 /*****************************************************************************
13 #include <dos/record.h>
14 #include <proto/dos.h>
16 AROS_LH2(BOOL
, LockRecords
,
19 AROS_LHA(struct RecordLock
*, recArray
, D1
),
20 AROS_LHA(ULONG
, timeout
, D2
),
23 struct DosLibrary
*, DOSBase
, 46, Dos
)
27 Lock several records at the same time. The timeout specified is applied
28 to each lock to attempt. The array of RecordLock:s is terminated with
29 an entry where rec_FH is equal to NULL.
33 recArray -- array of records to lock
34 timeout -- maximum number of ticks to wait for a lock to be ready
38 Success/failure indication. In case of a success, all the record locks
39 are locked. In case of failure, no record locks are locked.
43 A set of records should always be locked in the same order so as to
44 reduce possiblities of deadlock.
56 *****************************************************************************/
60 struct RecordLock
*rLock
= recArray
;
62 while (BADDR(recArray
->rec_FH
) != NULL
)
66 if (!LockRecord(recArray
->rec_FH
, recArray
->rec_Offset
,
67 recArray
->rec_Length
, recArray
->rec_Mode
, timeout
))
69 temp
= recArray
->rec_FH
;
71 recArray
->rec_FH
= temp
;