[racket] flock() stops racket-5.1.1 build on Solaris x86
At Tue, 24 May 2011 12:33:47 +0100, Tim Brown wrote:
> > From a Racket implementor's perspective, the BSD side has it right.
> > It's not just subroutines within Racket, but different threads within a
> > single Racket process that might compete for a file lock; when a thread
> > fails to obtain a lock and closes a file, any thread in the same OS
> > process that held the lock immediately loses it.
>
> Do I understand this right?
>
> Thread 1 opens file f, gets fd1, and asserts a read lock, and obtains it
>
> Thread 2 opens file f, gets fd2, and asserts a read lock, and obtains it
>
> Thread 3 opens file f, gets fd3, and asserts a write lock...
> fails to obtains the lock and closes fd3 in disgust; which, by what
> I understand you're saying is "a thread fails to obtain a lock and
> closes a file"... do threads 1 and 2 lose their locks?
Yes, exactly.
I've pushed changes to avoid flock() under Solaris and to rename
`single'. Let me know if I got it wrong.