views:

70

answers:

1

I'm wondering if my implementation should expect that reentrant mutex's are supported or not. The code is supposed to portable/platform independent. I'm wondering if mutex recursion is common enough that it shouldn't be a concern.

+4  A: 

It's usually a distinct option, available through a different function call. Even then it isn't "detected" it's just "permitted".

Sometimes, you WANT the lock to be recursive. Sometimes, you DON'T want the lock to be recursive. Any solution you come up with without explicitly allowing both conditions will not work universally for every mutex solution available without you imposing some contraints that don't exist in the libraries you'll be wrapping.

San Jacinto