AppGuard interview question

Solve a multi-threading queuing problem with locking capabilities.