[Thinking is the gerund of the verb to think]. It is an impersonal way, and indicates someone is carrying out such an action at a given time.