File size: 588 Bytes
a21d9ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
    "task_id": "race_condition_hard_2",
    "task_name": "Race Condition",
    "description": "Find the race condition in the thread-safe counter",
    "difficulty": "hard",
    "code_diff": "class Counter:\n    def __init__(self):\n        self.count = 0\n    \n    def increment(self):\n        current = self.count\n        self.count = current + 1\n        return self.count",
    "expected_issues": [
        {
            "line": 6,
            "type": "race_condition",
            "severity": "high",
            "description": "Non-atomic increment operation"
        }
    ]
}