On Fri, Jan 02, 2026 at 05:35:01PM -0800, Jerry D wrote:
> > Recursive I/O shouldn't indeed be allowed, but multiple threads
> > trying to transfer concurrently should be fine (of course, locking
> > should be used for that).
> 
> I am looking for a way to check if libgomp is active and if so skip the
> check. If there is no such mechanism than I will revert the patch and we
> will need to find some other way to detect the recursive I/O.

IMHO it shouldn't depend on whether libgomp is linked or not, it can be also
dlopened later, or one could link against libpthread (which e.g. in newer
glibc is just in libc) and build threads manually etc.

When using pthread_mutex_*, if it was PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
rather than the normal mutex kind, you'd get EDEADLK from pthread_mutex_lock
if already locked by the current thread.  But guess it would need some extra
tweaks in gthr*.h.

        Jakub

Reply via email to