|
Currently I'm looking at using this code to make the lock.
IFSRandomAccessFile lockFile = new IFSRandomAccessFile(as400,
LOCKFILE, "rw");
IFSKey lockKey = lockFile.lock(0L, 10L);
I would think more appropriate, including the optional fourth
argument [int shareOption] for the open request, using the value of
SHARE_NONE; i.e. preventing an open by any other process\thread
irrespective that other thread properly implementing the
keyed-locking scheme.?
Also, I am unsure of the default for the optional fifth argument
[int existenceOption] for the open request, but possibly the value
OPEN_OR_FAIL is desirable if the semaphore is implemented as a "lock
on *a known* IFS file" [emphasis mine].?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.