IO library locking doesn't count readers
We aren't keeping track of the number of readers of a file, so that the first one to close a Handle removes the lock.
> main = do
> fc <- openFile "z" ReadMode -- sacrificial handle
> fr <- openFile "z" ReadMode
> hClose fc
> fa <- openFile "z" AppendMode
> hPutStr fa "append this line\n"
> hGetLine fr >>= print
this should fail.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.4.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | lowest |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | Unknown |
| Architecture | Unknown |
Edited by Simon Marlow