Make updates to external package state idempotent.
authorThomas Schilling <nominolo@googlemail.com>
Fri, 21 Aug 2009 23:53:55 +0000 (23:53 +0000)
committerThomas Schilling <nominolo@googlemail.com>
Fri, 21 Aug 2009 23:53:55 +0000 (23:53 +0000)
Without this, concurrent updates to the EPS could introduce
overlapping instances (even though they came from the same module).

compiler/iface/LoadIface.lhs

index 3a4cfe5..cedc447 100644 (file)
@@ -257,6 +257,7 @@ loadInterface doc_str mod from
                }
 
        ; updateEps_  $ \ eps -> 
+           if elemModuleEnv mod (eps_PIT eps) then eps else
            eps { 
              eps_PIT          = extendModuleEnv (eps_PIT eps) mod final_iface,
              eps_PTE          = addDeclsToPTE   (eps_PTE eps) new_eps_decls,