PApplet is a class, so I don’t know which method you’re talking about.
Regardless, threads are responsible to execute all the code it passes through.
The matter here is that the way Processing library is programmed, its main canvas is exclusive to its “Animation” Thread to touch it.