That depends on the definition. If it's "intentionally cause your own death", then sure. But psychologically it's not.
If we change the verb, it becomes intrusive thoughts. Spoiler If you hire someone to sex you, is it still masturbation?