Any functions which are running in the main function (thread mode) will be pre-empted by the Interrupt service routines (Handler mode).
So it is a general recommendation to ensure that the function being executed will not be corrupted by the pre-emption of Interrupts and their routeines if both the functions as well as interrupts access same peripherals. Please note that it is not in every case that ISR will corrupt the function that is being executed. In certain cases like printing a string in function will be interrupted by printing in the ISR.
If the time taken for the execution of the function is high and if you expect any ISR that writes to the same pin we recommend you make it as less as possible by removing extra wrapper functions.
Also you can call the API CyEnterCriticalSection() which disables all the interrupts and CyExitCriticalSection() enables the interrupts back.
The per pun API can be found in the System reference guide for the PSoC attached.