This is a repo with the sample code for my blog post:
Critical sections, reader/writer locks, interactive login sessions, root user detection, CFString conversion.
It covers the following tips:
- Critical Sections
- Reader/Writer Locks
- Conditional Reader/Writer Locks
- Synchronized Access Class
- How To Get The List of Current Interactive Login Sessions
- How To Get Interactive Login Session That This Process Runs In
- How To Convert CFStringRef into std::string
- How To Check If Process Is Running As Root
Please send your suggestions and corrections here.