This may be represented in a dream by such things as using a pump, beating a drum, or any rhythmic movement.
If there is a tendency to repress the sexual need, it may happen that one masturbates during sleep, in an attempt to release sexual pressure. Because the person has consciously decided not to allow sexuality, this might give rise to a feeling of being possessed by another will. In fact our unconscious will to express our needs has overridden the conscious decision during sleep. Out of such a split in the person, ideas about devils and possession probably arose. Although Christianity at a fundamental level appears to teach the love and acceptance of all sides of human nature—therefore integration through love thy neighbour as thyself, so love thyself—in practice it becomes tight morality which creates devils through rejection and splits in human nature. In many Christians, there are enormous conflicts between sexuality, love, work and spirituality. ... A Guide to Dreams and Sleep Experiences
To dream that you are masturbating implies that you have hidden fantasies and requirements regarding sex. It suggests that you should satisfy some inner personal needs. Perhaps you should try harder to strengthen the bond between you and your significant other.
To see others masturbating indicates that you are nervous about expressing your inner feelings and emotions. You feel restricted. It’s possible that some aspect of your life isn’t gratifying enough. This dream doesn’t always have a sexual meaning, but it may be indicative of some issue or association in your life.... Dream Symbols and Analysis
Dreams of masturbation represent that you are embracing the beauty of your own sexuality, unashamed to feel pleasure and make yourself happy. Alternatively, you may be processing conflicting issues of guilt and desire. Consider the feeling tone of this dream.... Strangest Dream Explanations
To dream that you are masturbating may represents unexpressed sexual needs/desires. It may also indicate you need to take care of yourself in emotional ways which are not necessarily sexual. You may need to put forth a little more effort toward some relationship.
To see others masturbating in your dreams can mean you’re worried about being too inhibited, or that a relationship with someone in your life is not satisfying you.... My Dream Interpretation