2 Copyright © 1995-2013, 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
)
26 Lock several records at the same time. The timeout specified is applied
27 to each lock to attempt. The array of RecordLock:s is terminated with
28 an entry where rec_FH is equal to NULL.
31 recArray - array of records to lock
32 timeout - maximum number of ticks to wait for a lock to be ready
35 Success/failure indication. In case of a success, all the record locks
36 are locked. In case of failure, no record locks are locked.
39 A set of records should always be locked in the same order so as to
40 reduce possiblities of deadlock.
51 *****************************************************************************/
55 struct RecordLock
*rLock
= recArray
;
57 while (BADDR(recArray
->rec_FH
) != NULL
)
61 if (!LockRecord(recArray
->rec_FH
, recArray
->rec_Offset
,
62 recArray
->rec_Length
, recArray
->rec_Mode
, timeout
))
64 temp
= recArray
->rec_FH
;
66 recArray
->rec_FH
= temp
;