rw lock playground example
main idea: https://stepik.org/lesson/67655/step/1?after_pass_reset=true&unit=44395
handle error: https://gist.github.com/pixelspark/e5836624303083ea2f04d59c25a468dd
docs: http://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_rwlock_init.html