Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by fluter for FreeRTOS locks and tasks

You need use locks to synchronize concurrent access to shared objects, the easiest scenario would be like:

lock_t l; // defines a lock of your system// thread 1:lock(l);counter += 1;unlock(l);// thread 2:lock(l);do_something(counter);unlock(l);

Viewing all articles
Browse latest Browse all 4

Trending Articles