Reader Writer Lock Implementation
Do I really need to take a lock in my WriteUnlock() method? It looks like all I'm doing is unlock right away.


YES, you need the lock, because you are accessing queuedWriters and you need to make sure nobody changes it (by calling writeLock) before you notify readers or writers based on the check. You could have seen queuedWriters being zero, therefore notifying readers, but some writer could get sleeping in the meantime and never get woken.


  And is it recommended to perform a lock.unlock() before I do a notify_one or a notify_all?


Unlock before, because the thread being woken would immediatelly try to hold the lock, thus being blocked again (to be woken for second time when you unlock).


  Does performing a condition_variable.wait(lock, lambda) where the lambda is true cause a performance loss?


It is same as while (!pred()) wait(lck);
What else could you do? It checks first, so, would not wait if the condition is true.