Page MenuHomeFreeBSD

thr_rtld: accept read lock requests while owning the lock for write
ClosedPublic

Authored by kib on Fri, May 2, 3:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 7, 12:23 AM
Unknown Object (File)
Tue, May 6, 3:44 AM
Unknown Object (File)
Mon, May 5, 10:49 AM
Unknown Object (File)
Mon, May 5, 7:52 AM
Unknown Object (File)
Sun, May 4, 1:19 PM
Unknown Object (File)
Fri, May 2, 6:42 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Fri, May 2, 3:38 PM

The logic appears fine. Out of curiosity, could you describe or provide some links to the context of this change? I think I saw several changes passing in rtld recently, but haven't followed.

lib/libthr/thread/thr_rtld.c
175–182

That trick extends the write lock as seen by other threads until all the references from the locking thread have been released (write but also read). Could that be a problem?

This revision is now accepted and ready to land.Fri, May 2, 4:15 PM

The logic appears fine. Out of curiosity, could you describe or provide some links to the context of this change? I think I saw several changes passing in rtld recently, but haven't followed.

See the referenced PR for the test case.

lib/libthr/thread/thr_rtld.c
175–182

This is the expected behavior, how could it be different? The last reference releases the exclusive/write lock.

Thanks, I hadn't seen it above.

lib/libthr/thread/thr_rtld.c
175–182

I was just wondering if that could be a problem in the context of the change. I do indeed see no other way without splitting _thr_rtld_lock_release() into 2 functions, one for the write lock and another one for read locks.