Cross-platform atomic operations and lock algorithm library