He spent the whole afternoon,locked and writing something in the room.
locked 前面省略了be动词,逗号后面的全部做伴随状语.