This commit removes any use of pthread.h from the RWLock header. It also
adds a win32 implementation of RWLock.
Support for interprocess RWLocks is left to a later PR.
Due to the API design of SRWLock the unlock methods must match the lock
method.
This commit adds in-place pimpl to abstract away the implementation of
Mutex. It also adds policies to configure the type of mutex desired.
Because of the tight integration between mutex and condition variables
they also needed to be reworked and the changes have to be in one commit
to retain atomicity.
A win32 and pthread implemenation is provided to make sure the api
works with both.
This commit splits out synchronization primitives from LibThreading into
LibSync. This is because LibThreading depends on LibCore, while LibCore
needs the synchronization primitives from LibThreading. This worked
while they were header only, but when I tried to add an implementation
file it ran into the circular dependency. To abstract away the pthread
implementation using cpp files is necessary so the synchronization
primitives were moved to a separate library.