We consider various versions of the obstacle and thin-obstacle problems, we interpret them as variational inequalities, with non-smooth constraint, and prove that they satisfy a new constrained Lojasiewicz inequality. The difficulty lies in the fact that, since the constraint is nonanalytic, the pioneering method of L. Simon ([25]) does not apply and we have to exploit a better understanding on the constraint itself. We then apply this inequality to two associated problems. First we combine it with an abstract result on parabolic variational inequalities, to prove the convergence at infinity of the strong global solutions to the parabolic obstacle and thin-obstacle problems to a unique stationary solution with a rate. Secondly, we give an abstract proof, based on a parabolic approach, of the epiperimetric inequality, which we then apply to the singular points of the obstacle and thin-obstacle problems.In the seminal paper [25], Leon Simon proved (1.3) for the flow associated to harmonic maps between two analytic manifolds. Notice that, also in this case, there is a geometric constraint given by the target manifold, but a change of coordinates allows to trivialize this constraint, while transforming the Dirichlet energy into an analytic functional F. In [25], Simon showed that the