Given,
Acceleration of lock m1 isa1.
Acceleration of lock m2 isa2.
String is non-stretchable
a2=2a1.......(1)
m2g−2T1=m2a2....(2)
T1=m1a1......(3)
From (1), (2) and (3)
a2=m2gm1+m2 and a1=m2g2(m1+m2)
Hence, acceleration of lock m1ism2g2(m1+m2) and acceleration of lock m2ism2g(m1+m2)