31 mex files without fixed maximal number of plans, dynamic lazy initialization and increase of array plans[], removed mexLock and mexUnlock after discussion with @michaelquellmalz
mexLock/mexUnlock: The mexUnlock function in cleanup could never be called, since cleanup (mexAtExit) was not called once mexLock was called in mkplan. Moreover, mexLock increments a counter at each call of mkplan which would require an equal number of calls of mexUnlock when a plan is finalized.
31 mex files without fixed maximal number of plans, dynamic lazy initialization and increase of array plans[], removed mexLock and mexUnlock after discussion with @michaelquellmalz
mexLock/mexUnlock: The
mexUnlock
function incleanup
could never be called, sincecleanup
(mexAtExit
) was not called oncemexLock
was called inmkplan
. Moreover,mexLock
increments a counter at each call ofmkplan
which would require an equal number of calls ofmexUnlock
when a plan is finalized.