From my understanding, BLE subsystem (BLESS) runs concurrently with the main loop in the main() function. If both share a variable, is it possible to get a race condition? If it is possible, how to prevent it? Does PSoC creater supplies a mutex like object that we can use to lock/unlock?
Yes BLESS and main runs parallel.All the BLE events will automatically call the BLE event handler. All processes will be updated to the stack while CyBleProcessEvents( ) is called. All the updates happens after this based on the BLE packets. If the code is written in the way as mentioned in the code examples, race conditions will not occur.