Some times deadlock free.Lets assume process i started executing, and executed until flag1=true and preempted, now process j is executing flag2=true and as flag1=true it will busy wait , again if its preempted process i will busy wait thus deadlock will occur. If process i or j executes without preemption, assuming flags values are initially false then mutual exclusion is there.