Processes, Threads & System Calls

Answer & solution
Official answer: A; D
Each process has its own address space, hence its own global x and lock. Within one process the lock serializes the two increments, giving x=2 after both threads finish. Each invocation has its own stack-local y, initialized to zero and incremented once, so every thread prints 1. The two processes do not share x merely because it is global. Thus A, D.
Threads share a process's global variables and synchronization objects, but ordinary separate processes do not share those objects without explicit shared-memory setup. Joining both threads ensures main prints after both increments. Each thread's y is an automatic local variable, so the lock is not needed to protect y, though it is needed for the shared x increment within each process.