Ticket #629 (closed bug: fixed)

Opened 7 years ago

Last modified 5 years ago

IO library locking doesn't count readers

Reported by: simonmar Owned by: simonmar
Priority: lowest Milestone: 6.8.3
Component: Compiler Version: 6.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: countReaders001 Blocked By:
Blocking: Related Tickets:

Description

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.

Change History

Changed 7 years ago by simonmar

  • summary changed from IO library locking bug to IO library locking doesn't count readers

Changed 7 years ago by igloo

  • testcase set to countReaders001
  • difficulty set to Unknown
  • milestone set to 6.6.1

Changed 6 years ago by simonmar

  • milestone changed from 6.6.1 to 6.8

Changed 6 years ago by simonmar

  • owner set to simonmar
  • milestone changed from 6.8 branch to 6.8.3

See also #1109. Locking could be changed to use a hash table, that would make things much easier.

Changed 6 years ago by simonmar

and #1753

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

Fixed, see #1109.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.