Gradle option to synchronized specific task

Hello guys, I’m wondering does Gradle provide some option or plugin, or something else to synchronized some specific task.
For example you can think for synchronized block/method in Java.
When we don’t want specific block of code to be accessible from multiple threads, we use synchronized block.
Equivalent to this, when we run gradle tasks in parallel, can we synchronized some specific task not to be accessible by multiple task executors?

Best regards, Mario.

What do you mean with “not accessible by multiple task executors”?
A task is anyway just run once at most during a given build.