ali1234 / raspi-teletext

Generate teletext with a Raspberry Pi
416 stars 23 forks source link

buffer_head, buffer_tail and vsync callback #11

Closed Tachiorz closed 7 years ago

Tachiorz commented 7 years ago

I'm not sure, but isn't incrementing buffer_head and buffer_tail a bit unsafe, taking into account that they’re accessed from different threads? https://github.com/ali1234/raspi-teletext/blob/6858705ba9da7d8917a22e52eb5e47452cc4bb18/buffer.c#L65 https://github.com/ali1234/raspi-teletext/blob/6858705ba9da7d8917a22e52eb5e47452cc4bb18/buffer.c#L86

ali1234 commented 7 years ago

No, because they are uint8_t and therefore guaranteed to be atomic.