Currently I'm looking at using this code to make the lock.
IFSRandomAccessFile lockFile = new IFSRandomAccessFile(as400,
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
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.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.