Thread-Style Operation on Microprocessor
What you are describing are two genuine threads. The ISR and the main routine share the same memory space. For your simple application it is not necessary to use an RTOS. To communicate between the two threads you need a global variable, and you need to declare it to be volatile in C so that the compiler doesn't try to optimize accesses to it.

You also need to be sure that all accesses to the global variable are atomic, meaning that changes to the variable cannot be interrupted. The simplest way of doing this is to disable all interrupts, modify or read the global variable, then enable the interrupts.