SIO_CLOSE_TRYLOCK
which causes Sgcclose()
to return -1 with
errno set to EDEADLK
if the stream is locked.
Alternatively, using SIO_CLOSE_FORCE
the stream is closed
and released without gaining a lock. This should be safe because the
stream is garbage and thus no thread can use the lock.
In addition, Sgcclose() never raises a Prolog exception because Prolog interaction is not allowed from the blob release hook and there is no meaningful way to raise a Prolog exception from this context.