>> I wanted to avoid spawning a thread and immediately just having it block waiting for a database connection...
>> The problem is that the database connection would sometimes use a re-entrant mutex when it was acquired from the pool...
>> with a normal mutex we would be fine, since you only one lock can exist and it doesn’t matter if we unlock it on a thread other than the one we locked it from...
>> Fundamentally, we just can’t have a re-entrant mutex be involved and also be able to pull the connection from the pool on a different thread than it is being used...
Truly good coders are very rare because it's not just about mastering all the available tools and abstractions, it's also about the ability to come up with abstractions that make it simple for anyone looking at the code to understand what is happening.
Good coders can write simple code to do complex things.