MPS issue job003885

TitleUnclear when to use AVERT in mpsi.c
Statusclosed
Prioritynice
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn mpsi.c, the code sometimes uses AVERT() and sometimes AVER(TESTT). Is there an important distinction? If so, it should be documented somewhere.
AnalysisAVERT is used inside ArenaEnter ... ArenaLeave and so need not be thread-safe, whereas AVER(TESTT) is used outside and so must be thread-safe.

This needs to be documented, but also, the code does not quite adhere to this. In mps_pool_create_v there's AVERT(PoolClass, pool_class) outside the arena lock, and a call to pool_class->varargs. Need to document in design.mps.keyword-arguments that varargs methods must be thread-safe.
How foundinspection
EvidenceNone
Created byGareth Rees
Created on2014-10-13 11:19:58
Last modified byGareth Rees
Last modified on2014-10-13 14:36:15
History2014-10-13 GDR Created.

Fixes

Change Effect Date User Description
187238 closed 2014-10-13 14:36:15 Gareth Rees Don't use AVERT unless the arena lock is held (it's not thread-safe in all varieties). Add design explaining this.