"Tom Lane" <tgl@sss.pgh.pa.us> writes>
> The alternative would be to move the Unlock loop in front of the
> addition of the LWLock to held_lwlocks[], but I think that cure
> is probably worse than the disease --- the chance of an error during
> Unlock seems nonzero.
>
Another alternative might use PG_TRY/PG_CATCH to make sure that the
semaphore is released. But seems this costs too much ...
Regards,
Qingqing