My function can be called concurrently by other‘s program using GCD. Can I lock resources by using pthread mutex?
Absolutely. At the end of the day, code running under GCD is just code running on a regular, old OS thread that just happens to be managed by GCD. As @Daniel points out, if you're using GCD throughout, you ought to use GCD's mechanisms for mutual exclusion (i.e. a serial queue), but if you're interoperating with legacy code that uses pthread mutexes to lock resources, you can certainly do that from within code executed by GCD as well.